All subjects · Mathematics · WST01 (S1)
The least squares regression line
The regression line of y on x is the straight line that best fits the data in the sense of least squares. It lets you predict y from x.
Least squares
For each point, the residual is the vertical distance from the point to the line (observed y minus predicted y). The least squares line makes the sum of the squared residuals as small as possible. It always passes through the mean point (x̄, ȳ).
Finding the line
The regression line of y on x is y = a + bx, with
b = Sxy / Sxx and a = ȳ - b x̄.
With Sxx = 82.5, Sxy = 200, x̄ = 5.5, ȳ = 42: b = 200/82.5 = 2.4242, a = 42 - 2.4242 × 5.5 = 28.667.
So y = 28.7 + 2.42x (to 3 s.f.). Keep full accuracy for b when you work out a.
Interpreting a and b
- b is the change in y for each increase of 1 in x, in context: 'each extra hour of sunshine is linked to about 2.42 more ice creams sold'.
- a is the value of y when x = 0; it may have no sensible meaning if x = 0 is far outside the data.
The line of y on x is for predicting y from x; it should not be rearranged to predict x from y.
Worked example
Find the regression line of y on x for n = 10, Σx = 55, Σy = 420, Sxx = 82.5, Sxy = 200.
- b = 200/82.5 = 2.4242...
- x̄ = 5.5, ȳ = 42
- a = 42 - 2.4242... × 5.5 = 28.666...
Answer: y = 28.7 + 2.42x
Check yourself
- Sxx = 82.5 and Sxy = 200. Find the gradient b of the regression line of y on x. Give your answer to 3 significant figures.
Show answer
2.42. b = 200/82.5 = 2.42.
- Sxx = 82.5, Sxy = 200, x̄ = 5.5, ȳ = 42. Find a in y = a + bx. Give your answer to 3 significant figures.
Show answer
28.7. a = 42 - (200/82.5)(5.5) = 28.7.
- Sxx = 40, Sxy = -48. Find b.
Show answer
-1.2. b = -48/40 = -1.2.
- The regression line of y on x has gradient b = -1.2, and x̄ = 15, ȳ = 30. Find a.
Show answer
48. a = 30 - (-1.2)(15) = 30 + 18 = 48.
- The regression line is y = 28.67 + 2.424x. Predict y when x = 7. Give your answer to 3 significant figures.
Show answer
45.6. 28.67 + 2.424 × 7 = 45.64.
- Which point does every least squares regression line of y on x pass through?
- (0, 0)
- (x̄, ȳ)
- (0, b)
- The point with the largest residual
Show answer
(x̄, ȳ). Since a = ȳ - bx̄, substituting x = x̄ gives y = ȳ.
- What does the least squares method minimise?
- The sum of the horizontal distances from the points to the line
- The number of points not on the line
- The gradient of the line
- The sum of the squares of the vertical distances from the points to the line
Show answer
The sum of the squares of the vertical distances from the points to the line. Residuals are vertical (in y) and are squared before adding.
Sources
- Pearson Edexcel International Advanced Level in Mathematics specification (issue 3), Unit S1
- Pearson Edexcel IAL Statistics S1 (WST01) examiners' report, October 2024
Last updated 7 November 2026. Spotted a mistake? Tell us.