James Ashton MathsFREE MATHEMATICS. OPEN TO EVERYONE.
HomeIB DiplomaA levelAbout
IB Diploma › Maths AI SL › Statistics & probability › Correlation & regression

Correlation & regression

Scatter diagrams, Pearson’s correlation coefficient r, and the regression line of y on x, all from the GDC. Then the parts examiners care about most: interpreting r and the parameters of the line, and knowing when a prediction can be trusted.

SL 4.4Paper 1Paper 2GDC allowed≈ 50 min to work through
Before you start: straight lines as models (Straight lines) and entering data in lists (Sampling & summary statistics).

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: positive, negative or none; strong or weakSL 4.4
  • Find Pearson’s r with the GDC and interpret it, including against a critical valueSL 4.4
  • Draw a line of best fit by eye through the mean point (x¯,y¯)SL 4.4
  • Find the regression line y=ax+b with the GDC and interpret a and bSL 4.4
  • Use the line for prediction, and explain the dangers of extrapolationSL 4.4
  • Know that correlation does not imply causationSL 4.4

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

Pearson’s r measures how close the points are to a straight line, from −1 (perfect negative) through 0 (no linear correlation) to +1 (perfect positive). The regression line is the best straight line through the data, and it lets you predict y from x. But a line is only as good as the data behind it: predictions outside the data, or from weak correlation, are unreliable.

2.1 Describing correlation

rDescription
0.75≤|r|≤1strong
0.5≤|r|<0.75moderate
0.25≤|r|<0.5weak
|r|<0.25very weak or none

These boundaries are a common convention, not a fixed rule. The sign gives the direction: positive (as x increases, y increases) or negative.

If a question gives a critical value of r for the sample size, the correlation is significant when |r| is greater than the critical value. Remember that r only measures linear correlation, and that correlation does not show that one variable causes the other.

2.2 The regression line on the GDC

Worked example 1Paper 1
Hours of study x and test score y for 8 students: x: 2, 3, 5, 6, 8, 9, 11, 12; y: 45, 50, 58, 60, 70, 72, 80, 85. Find (a) r and describe the correlation (b) the regression line of y on x (c) the predicted score for 7 hours of study.
Enter the data in two lists, then menu → Statistics → Stat Calculations → Linear Regression (ax+b).
(a) r=0.998: very strong positive linear correlation
(b) y=3.89x+37.8
The TI-Nspire writes the line as y = ax + b, the same form as the IB.
(c) y=3.89(7)+37.8=65.0
7 hours is inside the range of the data (2 to 12), so this is interpolation: reliable.
Interpreting the line y=ax+b Not in booklet: learn it

a (gradient): the change in y for each increase of 1 in x. Here, each extra hour of study adds about 3.9 marks.
b (intercept): the value of y when x=0. Here, a student who did not study is predicted to score about 38. Only interpret b if x=0 makes sense in context.
The line always passes through the mean point (x¯,y¯).

2.3 When to trust a prediction

  • Interpolation (inside the range of the x data) with strong correlation: reliable.
  • Extrapolation (outside the range): unreliable, because the pattern may not continue.
  • Weak correlation: any prediction is unreliable.
  • The line of y on x predicts y from x. Do not use it to predict x from y.
Worked example 2Paper 2
The age x (years) and price y (thousand euros) of 8 cars of the same model: x: 1 to 8; y: 24.5, 21.0, 19.2, 17.0, 14.8, 13.1, 11.9, 10.2. (a) Find r and the regression line. (b) Interpret the gradient. (c) Comment on using the line for a car aged 15 years.
(a) r=−0.991; y=−1.98x+25.4
(b) The price falls by about €1980 for each extra year of age.
(c) 15 years is outside the data (1 to 8 years): extrapolation. The line predicts −4.3 thousand euros, which is impossible, so it is not reliable.
A negative price is a clear sign the linear model breaks down.
Worked example 3 (faded)Paper 1
For data with x¯=25.4 and y¯=173, the regression line is y=7.13x−8.06. Check that the line passes through the mean point.
7.13×25.4−8.06= 173 ✓  ← you work this out
On your TI-Nspire Calculator tricks →

Put x in one list and y in another. menu → Statistics → Stat Calculations → Linear Regression (ax+b): choose the X List and Y List. The output gives a, b, r2 and r. To see the scatter diagram and line, use a Data & Statistics page: put the lists on the axes, then menu → Analyze → Regression → Show Linear (ax+b).

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

  • Describing r=−0.9 as "weak" because it is negative. The sign is the direction; the size is the strength.
  • Saying that correlation proves one variable causes the other.
  • Using the regression line far outside the data without comment.
  • Predicting x from y using the line of y on x.
  • Interpreting the intercept when x=0 makes no sense in context.

Exam tips

  • Write r to 3 s.f. and describe it in words: "strong positive linear correlation".
  • When asked to interpret a, use the context and the units: "each extra hour adds about 3.9 marks".
  • "Is the prediction reliable?" Comment on two things: the strength of r, and whether it is interpolation or extrapolation.
  • If a critical value is given, compare |r| with it and state the conclusion in context.

5Practice

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

FluencyP1
Find r and the regression line for x: 1, 2, 3, 4, 5; y: 3, 5, 4, 7, 8.
r=0.915; y=1.2x+1.8
FluencyP2
Describe the correlation when r=−0.42.
Weak negative linear correlation
FluencyP3
A regression line is y=2.5x+10. Find the predicted y when x=6.
25
FluencyP4
For 10 pairs, the critical value of r at 5% is 0.632. Is r=0.58 significant?
No: 0.58<0.632
Problem solvingP5
Ice-cream sales rise with temperature, and so do sunburn cases. Does ice cream cause sunburn? Explain.
No: both are linked to a third factor (hot, sunny weather). Correlation does not imply causation.
Problem solvingP6
The data in worked example 1 ranges from 2 to 12 hours. Explain why predicting the score for 30 hours of study is unreliable.
It is extrapolation; the line would predict over 150 marks, which is impossible.

6Exam-style questions

Original questions in the style of the IB Maths AI SL exam, with full markschemes. Your GDC is allowed throughout: use it, but write down what you entered and what it gave you. Give yourself about 1 minute per mark.

Question 1Paper 1[7 marks]

The daily maximum temperature t (°C) and the number of cold drinks s sold at a kiosk were recorded on 9 days.

t182022242527293133
s120135150160175180200210230

  • (a)Find Pearson’s product-moment correlation coefficient, r.[2]
  • (b)Find the equation of the regression line of s on t.[2]
  • (c)Use your line to estimate the sales on a day with a maximum of 26 °C.[2]
  • (d)Interpret the gradient of the line in context.[1]
(a)
r=0.997 (0.99647…)A2
(b)
s=7.13t−8.06A1A1
(c)
7.129(26)−8.063(M1)
177 drinksA1
(d)
about 7 more drinks are sold for each 1 °C rise in temperatureR1
Question 2Paper 1[5 marks]

For 12 students, Pearson’s correlation coefficient between hours of sleep and a reaction-time score is r=−0.61. The critical value at the 5% level for 12 pairs is 0.576.

  • (a)Describe the correlation.[1]
  • (b)Determine whether the correlation is significant at the 5% level. Justify your answer.[2]
  • (c)A newspaper says "less sleep causes slower reactions". Comment on this claim.[2]
(a)
moderate negative (linear) correlationA1
(b)
|−0.61|=0.61>0.576M1
significantA1
(c)
correlation does not show causationR1
another factor may affect both (for example, stress or age)R1
Question 3Paper 2[7 marks]

The age x (years) and price y (thousands of euros) of eight cars of the same model are: (1,24.5), (2,21.0), (3,19.2), (4,17.0), (5,14.8), (6,13.1), (7,11.9), (8,10.2).

  • (a)Find the regression line of y on x.[2]
  • (b)Interpret the value of the y-intercept in context.[1]
  • (c)Use the line to estimate the price of a car that is 5.5 years old.[2]
  • (d)Explain why the line should not be used to estimate the price of a 15-year-old car.[2]
(a)
y=−1.98x+25.4A1A1
(b)
the estimated price of a new car (age 0) is about €25 400R1
(c)
−1.977(5.5)+25.36(M1)
€14 500 (14.485… thousand)A1
(d)
15 is outside the range of the data (extrapolation)R1
the line predicts a negative price, which is impossibleR1

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 these real IB Maths AI SL questions. Your school or teacher will have the papers.

PaperQuestionFocusDifficulty
May 2024 · TZ1 · Paper 2Q1Apartment price vs distance: r, rₛ, regression line, reliability★★★
May 2025 · TZ1 · Paper 1Q1Balloon volume vs passengers: r, regression line, interpret the gradient★★☆
May 2026 · TZ1 · Paper 1Q4Temperature vs children in a park: r, regression line, validity of a prediction★★☆
Nov 2023 · TZ1 · Paper 1Q1Walking time vs gradient: regression line, describe correlation, estimate★★☆
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