Correlation and regression (y on x)
In a minute
Pairs of measurements, such as a café's distance from a station and its daily customers, are . You describe how the two move together, measure a straight-line link with Pearson's , and predict with the of on . You also learn when a prediction can't be trusted.
You'll be able to
- Describe the on a by direction and strength.
- Draw a by eye through the point.
- Find Pearson's on your GDC, compare it with a , and know it measures straight-line links only.
- Explain why correlation does not show .
- Find on your GDC, predict with it, and interpret and .
- Spot unreliable predictions: , or using the line to predict .
Before you start3 quick questions on what this builds on
Revise first: 2.1 Straight-line equations, 2.6 Fitting and testing models and 4.3 Central tendency and dispersion
Scatter diagrams and lines of best fit
Do cafés further from a station get fewer customers? You need two measurements from each café, kept as a pair. Data in pairs is .
Put the variable that might explain the other on the -axis, and the one you want to predict on the -axis.
Direction: positive if tends to rise as rises, negative if it tends to fall, zero if there is no trend. Strength: strong if the points lie close to a line, weak if loosely spread, none if there is no pattern.
Try it first, then reveal one step at a time.
- Distance goes on the -axis. Plot the eight points (diagram below).
- As increases, decreases: negative. The points lie close to a line: strong.
- In context: cafés further from the station tend to have fewer customers.
- Strong negative correlation: cafés further from the station tend to have fewer customers.
A straight line through the middle of the points sums up a strong trend.
Plot the mean point, then rule a line through it with about as many points above as below. For its equation, read a second point off the line and use these booklet formulas from 2.1.
Try it first, then reveal one step at a time.
- (a) and , so the mean point is .
- (b) . Then , so .
- Check: . Correct.
- (c) Each extra parcel adds about minutes to a round.
Pearson's correlation coefficient
Strong and weak are judgements. Pearson's turns the correlation into one number.
The sign gives the direction. means every point lies on a straight line, means no linear correlation, and the closer is to , the stronger the correlation. If a question gives a table of strengths, use it.
Your GDC gives with the regression line. Exams expect the GDC value, not a hand calculation.
Try it first, then reveal one step at a time.
- Enter distances in the first list and customers in the second. Run linear regression: .
- is very close to : very strong negative linear correlation. Customer numbers fall steadily with distance.
With few points, a fairly large can happen by chance. A , given in the question, says how large must be for that number of pairs.
Try it first, then reveal one step at a time.
- Compare the size of with the critical value: , so it is significant.
- It is negative: warmer lakes tend to hold less oxygen.
- Significant negative linear correlation, since : warmer lakes tend to hold less oxygen.
only measures closeness to a straight line. Data on a clear curve can still have near , so look at the scatter diagram too.
Try it first, then reveal one step at a time.
- (a) Linear regression gives .
- (b) The points form a U-shape, lowest at km/h. Speed and fuel use are related, just not linearly, so the student is wrong.
Correlation is not causation
Correlation shows two variables move together. It doesn't show that changing one changes the other.
Often a third variable drives both, or the link is a coincidence. So correlation does not imply causation, however strong.
Try it first, then reveal one step at a time.
- (a) is close to and : strong, significant positive correlation.
- (b) Busy weeks bring more visitors, who buy more drinks and have more accidents. Visitors drive both, so fewer drinks wouldn't reduce injuries.
- Strong positive correlation, but correlation does not imply causation: the number of visitors drives both.
Try it first, then reveal one step at a time.
- : significant positive linear correlation.
- But wealthier towns have more gyms and also better healthcare. Wealth could drive both, so the data can't support the headline.
- Significant positive correlation, but correlation does not imply causation: wealth could drive both.
The regression line of y on x
Lines drawn by eye differ from person to person. The regression line comes from a fixed rule.
Here is the and is the : with new letters. Your GDC finds , and together.
Try it first, then reveal one step at a time.
- (a) Enter and in two lists and run linear regression: , ,
- Write it as an equation: .
- (b) cycles is . With the full values, , so about .
Interpret them with the question's variables and units. only means something if makes sense and is near the data.
Try it first, then reveal one step at a time.
- : for each extra charge cycles, the capacity falls by about percentage points.
- : a new battery ( cycles) is predicted to have . That is sensible, as is just outside the data.
- For each extra charge cycles the capacity falls by about percentage points; a new battery is predicted to have .
Try it first, then reveal one step at a time.
- (a) Each extra dollar per litre goes with about thousand more daily passengers, on average.
- (b) is the prediction for free petrol, far outside the data.
- (c) The change is thousand. Substituting would give passengers at a price of , not the change.
Reliable predictions
Trust a prediction from the on line only if the correlation is strong, is inside the data, and you are predicting .
Inside the data is . Outside is : the trend may not carry on there.
The line minimises vertical distances, which suits predicting . It was not fitted to predict , so rearranging it is not reliable.
Try it first, then reveal one step at a time.
- (a) : . Interpolation with near : reliable.
- (b) : , an impossible negative capacity. Extrapolation: the straight-line trend can't continue.
Try it first, then reveal one step at a time.
- That rearranges the on line to predict .
- The line was fitted for predicting from , by vertical distances. A line fitted the other way round is different unless .
- The line of on is for predicting from , so it cannot reliably predict from a value of .
Common mistakes
- Writing only and . Give the line as an equation, such as .
- Giving too few figures, such as for . Give 3 s.f., and predict with the full GDC values.
- Rearranging the on line to predict . It is built to predict only.
- Interpreting without context, or saying only that rises. Say how much changes per unit of .
- Claiming causation because is close to . Correlation does not imply causation.
Exam tips
- Write down : read it off your GDC, to 3 s.f. with its sign.
- Estimate: write the substitution into the line before the answer. That earns the method mark.
- Explain why an estimate may be unreliable: extrapolation, weak correlation, or predicting from a on line, in context.
Key takeaways
Practise this
23 past-paper questions on Correlation and regression in the AI HL bank, each with a mark scheme and a worked explanation.