Simple linear regression (least squares)
The least-squares line ŷ = b₀ + b₁x predicts a quantitative response from one predictor by minimising the sum of squared residuals.
- slope: estimated change in mean y per one-unit increase in x
- intercept: predicted y when x = 0
- and
- correlation and sample standard deviations
- fitted (predicted) value for observation i
- residual: observed minus fitted
When to use
- Describing and predicting a quantitative response y from one quantitative predictor x when the scatter plot looks roughly linear.
Assumptions
For description, none beyond a sensible straight-line pattern. For inference (tests, intervals) the LINE conditions: Linear mean, Independent errors, Normal errors, Equal variance — see residual diagnostics.
How to interpret
- Slope in context: "each additional unit of x is associated with an average change of units in y."
- Intercept only matters when x = 0 is meaningful and inside the data range.
- The line always passes through and the residuals sum to 0.
Common mistakes
- Extrapolating far outside the observed x range.
- Reading the slope causally from observational data.
- Swapping x and y: regressing x on y gives a different line (unless ).
- Fitting a line to a clearly curved pattern; check the residual plot.
Example
x = 1, 2, 3, 4, 5, 6 (spend), y = 3, 5, 4, 7, 8, 9 (sales).
- , , , , so and .
- : each extra thousand SAR of spend goes with 1.2 more units of sales on average. At x = 4 the prediction is 6.6.
- Residuals: 0, 0.8, −1.4, 0.4, 0.2, 0 (they sum to 0).