Least Squares Regression Lines From Summary Statistics | Edexcel A Level Further Maths notes

Free preview: Least Squares Regression Lines From Summary Statistics

The Line of Best Fit, Done Properly

Year 1 (AS) for OCR B (MEI), where it is in the Statistics Minor (the AS content). Edexcel teaches it in Further Statistics 2. For Edexcel and OCR A, check your own specification for whether it is taught in Year 1 or Year 2.

Ask ten people to draw a line of best fit by eye on the same scatter diagram and you get ten different lines. Which is "best"? We need a rule everyone agrees on, so that everyone gets the same line and the same predictions.

You met regression lines in A Level Maths, mostly from a calculator. Now we see what "best" means and calculate the line from summary statistics.

The words you need

  • The independent (explanatory) variable x is the one controlled or measured first.
  • The dependent (response) variable y is the one we want to predict.
  • For each point, the vertical gap from the point to the line, e=y−(a+bx), is called its residual.

Eight data points with the regression line y = 11.40 + 1.980x drawn through them; short vertical segments join each point to the line, showing the residuals, some above and some below the line

Following the diagram

  • The line is the regression line of y on x for the eight points from the PMCC note.
  • Each short vertical segment is a residual: positive above the line, negative below.
  • The least squares line is the one that makes the sum of the squared residuals as small as possible.
  • Why vertical gaps? Because we are predicting y from x, so errors in y are what matter.

y=a+bx,b=SxySxx,a=y¯−bx¯

💡 In plain words

  • b is the gradient: how much y changes, on average, when x goes up by 1.
  • The line always passes through the mean point (x¯,y¯), which is how a is found.

Where the formula comes from

  1. It can be shown that the best line passes through (x¯,y¯). So measure from there: let X=x−x¯ and Y=y−y¯, and the line is Y=bX.
  2. Sum of squared residuals: ∑(Y−bX)2=∑Y2−2b∑XY+b2∑X2=Syy−2bSxy+b2Sxx.
  3. This is a quadratic in b with positive b2 coefficient. Its minimum is where the derivative is zero: −2Sxy+2bSxx=0, so b=SxySxx.

Method: the regression line of y on x

  1. Find Sxx and Sxy (and x¯,y¯).
  2. b=SxySxx.
  3. a=y¯−bx¯, using the unrounded b.
  4. Write y=a+bx with sensible rounding (3 or 4 s.f.).

👀 Watch me do it: the eight points from the PMCC note: Sxx=98,Sxy=194,x¯=7.5,y¯=26.25

What I writeWhy I do it
b=19498=1.980Step 2: positive, matching the positive correlation.
a=26.25−1.980×7.5=11.40 (using the unrounded b)Step 3: 1.97959... times 7.5 = 14.847.
Regression line: y=11.40+1.980xStep 4.

✏️ YOUR TURN 1

Try this first:

For 10 pairs: ∑x=50,∑y=180,∑x2=310,∑xy=1020. Find the regression line of y on x.

Answer:

  • Sxx=310−50210=60, Sxy=1020−50×18010=120.
  • b=12060=2, a=18−2×5=8.
  • y=8+2x.

Making Predictions

Using the line

  • To predict y for a given x, substitute: at x = 9, y=11.40+1.980×9=29.2.
  • Interpolation (x inside the range of the data, here 2 to 13) is fairly reliable, especially if r is close to ±1.
  • Extrapolation (x outside the range) is unreliable: the pattern may not continue.

Unlock the full note: start 7 days free.

Log in or subscribe to read the rest of this note. Members also get the AI tutor, practice quizzes, mock exams and flashcards for this topic.

Log in · Subscribe · Start free trial

All notes in Linear Regression and Residuals

  1. Least Squares Regression Lines From Summary Statistics
  2. Residuals and the Residual Sum of Squares

What's inside for this topic

2 teacher notes, 76 practice questions, 45 flashcards, 2 quizzes.

Get the full notes, every practice question, flashcards, quizzes and mock papers.

Start your free 7-day trial

Questions? Chat with us on WhatsApp · Try one live lesson

Next note: Residuals and the Residual Sum of Squares

Least Squares Regression Lines From Summary Statistics on other exam boards

All Edexcel A Level Further Maths topics · A Level Further Maths