- A foundational technique in statistics
- Models the relationship between one independent variable
Xand a dependent variableY - Example: Predict miles per gallon (mpg) from horsepower (hp) using
mtcarsdataset
X and a dependent variable Ymtcars datasetWe assume a linear relationship between \(Y\) and \(X\):
\[ Y = \beta_0 + \beta_1 X + \epsilon \]
Where:
We will use the mtcars dataset built into R.
\[ \text{mpg} = \beta_0 + \beta_1 \cdot \text{hp} \]