Linear Regression is a useful tool for data analysis and for making predictions on the data. It does this by finding the line of best fit between the independent and dependent variables. A simple linear regression does this for only one independent variable corresponding to one dependent variable. We can create a linear model with the lm() function in r. The formula for the linear model is expressed as y ~ x.
data = Orange #Growth of Orange Trees Dataset linear_model = lm(circumference ~ age, data= data)