Correlation & regression
Scatter diagrams, Pearson's correlation coefficient, regression lines of on and on , and using them sensibly to make predictions.
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)SL 4.4
- Find and interpret Pearson's correlation coefficient SL 4.4
- Draw a line of best fit by eye through the mean pointSL 4.4
- Find the regression line of on with the GDC and use it to predictSL 4.4
- Know when a prediction is reliable (interpolation, strong correlation)SL 4.4
- Use the regression line of on to predict SL 4.10
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.
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.
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 lies between and . Close to : strong linear correlation. Close to 0: weak or no linear correlation.
- : positive correlation; : negative correlation.
- Correlation does not imply causation: both variables may depend on a third.
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, only measures linear relationships: data that follows a clear curve can have close to 0.
2.2 Regression lines
The regression line of on , , is the line that best predicts from . It always passes through the mean point . Interpret as the change in for each increase of 1 in .
"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 , then each extra hour of study is linked to about 4.6 more marks. The -intercept may not make sense if is far outside the data.
2.3 Reliable predictions
- Interpolation (inside the range of the data) with a strong is reliable.
- Extrapolation (outside the range) is unreliable.
- Use the on line to predict . To predict from , use the regression line of on (SL 4.10): it is a different line.
Enter and in two columns of a Lists & Spreadsheet page. Then menu → 4: Statistics → 1: Stat Calculations → 3: Linear Regression (mx+b). The output gives , and . For on , swap the X List and Y List.
3Explore it
Move the last data point. Watch how one unusual point changes and pulls the regression line. The cross marks the mean point.
4Common mistakes & exam tips
Common mistakes
- Using the on line to predict .
- Extrapolating far outside the data and calling it reliable.
- Saying a strong correlation proves that one variable causes the other.
- Describing 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 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.
6Exam-style questions
Original questions in the style of the IB exam, with full markschemes. Give yourself about 1 minute per mark.
The temperature (°C) and hot drink sales at a café were recorded: : 10, 15, 20, 25, 30, 35; : 52, 48, 45, 39, 35, 30.
- (a)Find Pearson's correlation coefficient .[2]
- (b)Describe the correlation.[1]
- (c)Find the regression line of on .[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) | |
| A2 | |
| (b) | |
| Very strong negative linear correlation | A1 |
| (c) | |
| A1 A1 | |
| (d) | |
| (about 37 drinks) | A1 |
| (e) | |
| on : , giving 21.9 °C | A1 |
For a data set, and . The regression line of on is .
- (a)Find .[2]
- (b)Interpret if is the number of hours worked and is pay in euros.[2]
| (a) | |
| M1 | |
| A1 | |
| (b) | |
| Pay increases by €4 | A1 |
| for each extra hour worked | A1 |
Match each value of to a description: , , .
| : very strong positive | A1 |
| : moderate negative | A1 |
| : no linear correlation | A1 |
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 IB questions. Your school or teacher will have these papers.
| Paper | Question | Focus | Difficulty |
|---|---|---|---|
| May 2025 · TZ2 · Paper 2 | Q1 | Regression line of sleep time on play time, then estimate at x=20 | ★☆☆ |
| May 2025 · TZ1 · Paper 2 | Q5 | Choose correct regression line, find mean point, find normal standard deviation | ★★☆ |
| May 2024 · TZ1 · Paper 2 | Q6 | Find r; critique extrapolation and wrong regression line for estimates | ★★☆ |
| Nov 2024 · TZ1 · Paper 2 | Q8 | Canada population: linear regression, exponential and logistic models, compare derivatives | ★★★ |
