Linear regression attempts to model the relationship between two or more variables by fitting a linear equation \(y = \beta_o + \beta_1x\) to observed data.
January 17, 2021
Linear regression attempts to model the relationship between two or more variables by fitting a linear equation \(y = \beta_o + \beta_1x\) to observed data.
mtcarsOur goal is to identify which predictor best predicts gas mileage. We simply fit a simple linear regression model, and use the variable that has the strongest positive correlation to mpg.
Let’s now fit a linear regression model that shows the relationship between mpg, our response variable, and drat, our predictor.
Let’s see how the residuals look like on a scatter plot to better visualize how good our model is. To assess, the points should be close to zero and doesn’t show any pattern.