The least-squares regression line
Lines of best fit, residuals, the least-squares regression line and its formulas in terms of r and the standard deviations, the line passing through the mean point, and interpreting the gradient and intercept in context.
Residuals and least squares
A line of best fit $\hat{y} = a + bx$ gives a predicted value $\hat{y}$ for each $x$. The residual of a data point is $$\text{residual} = y - \hat{y},$$ the vertical distance from the point to the line. The least-squares regression line is the line that makes the sum of the squared residuals as small as possible.
Adjust the gradient b and intercept a. The least-squares line makes the sum of squared residuals as small as possible: about 13.9.
Try $b = 3.7$ and $a = 48$. How close can you get to $13.9$?
Finding the line
Here $s_x$ and $s_y$ are the standard deviations of $x$ and $y$. The second formula shows that the line always passes through the mean point $(\bar{x}, \bar{y})$. In practice a calculator gives $a$, $b$ and $r$ directly from the data.
For the study data, $\bar{x} = 3.5$, $\bar{y} = 61$, $s_x \approx 1.871$, $s_y \approx 7.043$ and $r \approx 0.9715$. Find the least-squares line.
Interpreting the line
- The gradient $b$ is the predicted change in $y$ for each increase of $1$ in $x$. Here, each extra hour of study adds about $3.66$ marks.
- The intercept $a$ is the predicted $y$ when $x = 0$. Here, a student who doesn't study is predicted to score about $48$. It only has a sensible meaning when $x = 0$ is a reasonable value.
$r = 0.8$, $s_x = 5$ and $s_y = 10$. Find the gradient $b$.
$0.8 \times 2$.
$b = 2$, $\bar{x} = 8$ and $\bar{y} = 50$. Find the intercept $a$.
$50 - 16$.
$r = -0.6$, $s_x = 4$ and $s_y = 10$. Find $b$.
$-0.6 \times 2.5$.
A data point is $(3, 61)$, and the line predicts $\hat{y} = 59$ at $x = 3$. Find the residual.
$61 - 59$.
A data point is $(4, 60)$ and the line predicts $63$. Find the residual.
$60 - 63$. The point is below the line.
The least-squares line minimises:
That is what "least squares" means.
For $\hat{y} = 48.2 + 3.66x$ (score against hours of study), the gradient means:
Change in $y$ per unit increase in $x$.
Every least-squares regression line passes through:
$a = \bar{y} - b\bar{x}$ rearranges to $\bar{y} = a + b\bar{x}$.
If $r$ is negative, the gradient of the least-squares line is:
$b = r\,\tfrac{s_y}{s_x}$ and standard deviations are positive.
New numbers every time. Keep going until you get five in a row.
Coaching Centre