The Least-Squares Regression Line
Why the regression line is the one that minimizes the sum of squared residuals, how to get its slope, y-intercept, r and r² from technology, and how to interpret each in context.
Of all possible lines, the least-squares regression line (LSRL) is the one with the smallest sum of squared residuals. It always passes through \((\bar{x}, \bar{y})\). Technology gives its slope \(b\), y-intercept \(a\), and the correlation \(r\). Interpret the slope as a predicted change per one-unit increase in x, the intercept as the predicted y at x = 0 (when that makes sense), and \(r^2\) as the share of variation in y accounted for by the line.
1Why “least squares”
The simple linear regression model is fit to the data by minimizing the sum of the squares of the residuals. That is why it is called the least-squares regression line. Squaring keeps positive and negative residuals from canceling and penalizes large misses more than small ones.
The residuals from the least-squares line always add to 0, and so do the residuals of many other lines. What the LSRL minimizes is the sum of the squared residuals.
2Getting the line
The slope \(b\), the y-intercept \(a\), and the correlation \(r\) are calculated using technology. The line always passes through the point \((\bar{x}, \bar{y})\).
Used cars
Ages (years): 1, 2, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10. Prices (thousand dollars): 24.1, 23.6, 21.4, 20.6, 18.6, 21.0, 17.8, 15.0, 15.6, 12.0, 12.6, 9.4. Find the least-squares regression line, r, and r².
- 1Enter age in L1 and price in L2. STAT, CALC, LinReg(a+bx) L1, L2 (with DiagnosticOn).
- 2Output: a ≈ 25.688, b ≈ −1.583, r ≈ −0.978, r² ≈ 0.957.
The calculator’s numbers satisfy \(b = r\dfrac{s_y}{s_x}\) and \(a = \bar{y} - b\bar{x}\). For the cars, \(b = -0.978(4.75/2.94) \approx -1.58\). The second formula is why the line goes through \((\bar{x}, \bar{y})\).
3Interpreting the slope and the y-intercept
The slope and y-intercept are statistics: they come from a sample of values. The slope is the predicted increase or decrease in the response for a one-unit increase in the explanatory variable. The y-intercept is the predicted response when the explanatory variable equals 0.
Used cars
Interpret the slope, −1.583, in context.
- 1The slope is the predicted change in the response for a one-unit increase in the explanatory variable.
- 2Use “predicts”: the slope describes the model, not what happens to each car.
“For each additional year of age, the model predicts a decrease of 1.583 thousand dollars in price.”
“Each car loses 1.583 thousand dollars a year” is not what the slope says. Individual cars scatter around the line. The slope describes the model’s predicted change.
Two models
(a) Interpret the y-intercept of the car model, 25.688. (b) A model for students gives predicted arm span = −4.2 + 1.03(height), both in centimeters. Does its y-intercept have a sensible meaning?
- 1(a) At age 0 (a new car) the model predicts a price of 25.688 thousand dollars. The data start at age 1, so this is a mild extrapolation.
- 2(b) The intercept predicts an arm span of −4.2 cm for a height of 0 cm. No student is 0 cm tall, and arm span cannot be negative.
Sometimes x = 0 is far outside the data (extrapolation), or the predicted value is impossible, such as a negative length. Then say that the intercept has no reasonable interpretation in context.
4r², the coefficient of determination
The square of the correlation, \(r^2\), is the coefficient of determination. It is the proportion of the variation in the response variable that is accounted for by the linear relationship with the explanatory variable.
Used cars
Interpret \(r^2 = 0.957\).
- 1r² is the proportion of variation in the response accounted for by the linear relationship with the explanatory variable.
r = −0.978 gives direction and strength; r² = 0.957 is a proportion of variation and is never negative. To get r from r², take the square root and attach the sign of the slope: \(-\sqrt{0.957} \approx -0.978\).
Quick reference
| Piece | Interpretation template |
|---|---|
| Slope b | For each additional [unit of x], the model predicts an increase (decrease) of [|b|] [units of y]. |
| Intercept a | The model predicts [a] [units of y] when [x] = 0 (only if x = 0 is sensible and near the data). |
| r | r measures the strength and direction of the linear association between [x] and [y]. |
| r² | About [r² as %] of the variation in [y] is accounted for by the linear relationship with [x]. |
| Facts | Minimizes Σ(residual²); passes through \((\bar{x}, \bar{y})\); residuals sum to 0 |