Simple linear regression models the relationship between a single predictor variable \(x\) and a response variable \(y\) by fitting a straight line.
The goal is to find the line that best summarizes how \(y\) changes as \(x\) changes.
- Predictor (\(x\)): the explanatory variable (e.g. weight of a car)
- Response (\(y\)): the outcome we want to explain (e.g. fuel efficiency)
We use the built-in mtcars data set throughout: does a car’s weight predict its miles per gallon?