James Ashton MathsFREE MATHEMATICS. OPEN TO EVERYONE.
HomeIB DiplomaA levelAbout
A level Maths › Statistics · Sampling & data › Correlation & regression

Correlation & regression

Scatter diagrams, Pearson's correlation coefficient, regression lines of y on x and x on y, and using them sensibly to make predictions.

Stats 2.2Year 1≈ 45 min to work through
Before you start: straight lines and the mean. See Straight lines and Data.

1What you need to know

Tick these off as you go. By the end of the page you should be able to do all of them without notes.

  • Describe correlation from a scatter diagram (direction and strength)Y1
  • Find and interpret Pearson's correlation coefficient rY1
  • Draw a line of best fit by eye through the mean pointY1
  • Find the regression line of y on x with your calculator and use it to predictY1
  • Know when a prediction is reliable (interpolation, strong correlation)Y1
  • Use the regression line of x on y to predict xY1

2Notes & worked examples

Each idea is followed by a worked example. Try the question yourself first, then reveal the solution one step at a time.

The big idea

When two quantities are measured together (hours studied and test score, height and arm span), a scatter diagram shows whether they are related. The correlation coefficient measures how close the points are to a straight line, and the regression line lets you make predictions.

Edexcel specification note: going further

For Edexcel A level (Stats 2.2), calculations involving regression lines are excluded: you need to interpret a regression line given to you, make predictions within the range of the data and explain the danger of extrapolation. You are expected to find r on your calculator and interpret it; testing r is on the Normal & correlation hypothesis tests page. The sections on finding the regression line go beyond the A level course: treat them as an extension, useful if you go on to Further Mathematics or study statistics later.

2.1 Correlation

Positive correlation: as one variable increases, the other tends to increase. Negative correlation: as one increases, the other tends to decrease. The closer the points lie to a straight line, the stronger the correlation.

  • Pearson's r lies between −1 and 1. Close to ±1: strong linear correlation. Close to 0: weak or no linear correlation.
  • r>0: positive correlation; r<0: negative correlation.
  • Correlation does not imply causation: both variables may depend on a third.
Correlation is not causation

Ice cream sales and drowning numbers are positively correlated, but ice cream does not cause drowning. Both increase in hot weather. Correlation only tells you that two variables move together; it does not tell you why. Also, r only measures linear relationships: data that follows a clear curve can have r close to 0.

2.2 Regression lines

The regression line of y on x, y=ax+b, is the line that best predicts y from x. It always passes through the mean point (x¯,y¯). Interpret a as the change in y for each increase of 1 in x.

"Best" has a precise meaning. For each point, measure the vertical distance to the line (the prediction error). The regression line is the line that makes the total of the squared errors as small as possible. Your calculator finds it for you.

The gradient has a meaning in context. If score =4.6×hours+36, then each extra hour of study is linked to about 4.6 more marks. The y-intercept may not make sense if x=0 is far outside the data.

Worked example 1Calculator
Hours studied x: 2, 3, 5, 6, 8, 9. Test score y: 45, 50, 62, 65, 78, 80. Find r and the regression line of y on x, and predict the score for 7 hours.
calculator: r=0.996: a very strong positive linear correlation.
y=5.17x+34.9
x=7: y=5.17(7)+34.9=71.1
7 is inside the data range (interpolation) and r is close to 1, so the prediction is reliable.

2.3 Reliable predictions

  • Interpolation (inside the range of the data) with a strong r is reliable.
  • Extrapolation (outside the range) is unreliable.
  • Use the y on x line to predict y. To predict x from y, use the regression line of x on y: it is a different line.
Worked example 2Calculator
For the data above, estimate the hours studied by a student who scored 70.
Predicting x from y: use the regression line of x on y.
calculator: x=0.192y−6.65
y=70: x=6.78 hours
Worked example 3 (faded)No calculator
The mean point of a data set is (5.5, 63.3) and the regression line of y on x has gradient 5.17. Find the y-intercept.
63.3=5.17(5.5)+b, so b= 34.9  ← you work this out
On your Casio ClassWiz Calculator tricks →

Open the Statistics app → y = a + bx, enter the x and y values, then view the regression results: a, b and the correlation coefficient r. Note that the ClassWiz writes the line as y=a+bx, so b is the gradient.

3Explore it

Move the last data point. Watch how one unusual point changes r and pulls the regression line. The cross marks the mean point.

4Common mistakes & exam tips

Common mistakes

  • Using the y on x line to predict x.
  • Extrapolating far outside the data and calling it reliable.
  • Saying a strong correlation proves that one variable causes the other.
  • Describing r without both direction and strength.

Exam tips

  • Interpret the gradient in context with units, e.g. "the score increases by about 5.2 marks per extra hour".
  • Give r to 3 s.f. and describe it in words.
  • A line of best fit by eye should pass through the mean point.

5Practice

Fluency questions build the basics. Problem-solving questions make you think about which method to use.

FluencyP1
Describe the correlation when r=−0.92.
Strong negative linear correlation.
FluencyP2
Describe the correlation when r=0.15.
Very weak (almost no) positive linear correlation.
FluencyP3
The regression line is y=2.4x+10. Predict y when x=5.
22
FluencyP4
The mean point is (4, 20) and the line has gradient 3. Find the equation of the line.
y=3x+8
Problem solvingP5
Ice cream sales and drownings are strongly positively correlated. Does eating ice cream cause drowning?
No: both increase in hot weather. Correlation does not imply causation.
Problem solvingP6
A regression line was found from x-values between 10 and 35. Explain whether a prediction at x=60 is reliable.
No: it is extrapolation, far outside the data range.

6Exam-style questions

Original exam-style questions with full markschemes. Edexcel papers allow a calculator throughout, but questions labelled “No calculator” practise exact working. Allow about 1.2 minutes per mark.

Question 1Calculator[7 marks]

The temperature x (°C) and hot drink sales y at a café were recorded: x: 10, 15, 20, 25, 30, 35; y: 52, 48, 45, 39, 35, 30.

  • (a)Find Pearson's correlation coefficient r.[2]
  • (b)Describe the correlation.[1]
  • (c)Find the regression line of y on x.[2]
  • (d)Predict the sales when the temperature is 28 °C.[1]
  • (e)Use an appropriate regression line to estimate the temperature on a day when 42 drinks were sold.[1]
(a)
r=−0.997A2
(b)
Very strong negative linear correlationA1
(c)
y=−0.886x+61.4A1 A1
(d)
36.6 (about 37 drinks)A1
(e)
x on y: x=−1.12y+69.0, giving 21.9 °CA1
Question 2No calculator[4 marks]

For a data set, x¯=6 and y¯=40. The regression line of y on x is y=ax+16.

  • (a)Find a.[2]
  • (b)Interpret a if x is the number of hours worked and y is pay in euros.[2]
(a)
40=6a+16M1
a=4A1
(b)
Pay increases by €4A1
for each extra hour workedA1
Question 3No calculator[3 marks]

Match each value of r to a description: r=0.98, r=−0.5, r=0.02.

0.98: very strong positiveA1
−0.5: moderate negativeA1
0.02: no linear correlationA1

7Check yourself

Six quick questions, marked instantly. Aim for 6/6 before moving on. Fractions like 3/2 are accepted.

8Past-paper practice

Once you're scoring well above, try real Edexcel A level questions. Past papers and markschemes are on the Pearson website.

PaperQuestionFocusDifficulty
June 2018 · Paper 3Q2Hypothesis test for a correlation coefficient★☆☆
June 2025 · Paper 31Q4Sampling and a regression line from the large data set★★☆
June 2022 · Paper 31Q6Scatter diagram, regression and a correlation test★★★
Spotted a mistake on this page?Tell me and I'll fix it. The button opens an email with this page already named, or write to jamesashtonmaths@gmail.com.
Report a mistake