\[ y = \beta_0 + \beta_1 x + \epsilon \]
\[ \sum (y_i - \hat{y_i})^2 \]
using the built-in dataset mtcars, the two variables used for linear regression will be:
wt: weight of car
mpg: miles per gallon
Here is a ggplot showing that as weight goes up, mpg goes down
## `geom_smooth()` using formula = 'y ~ x'