Correlation and regression (y on x)
In a minute
Pairs of measurements, such as a car's age and its price, are . You learn to describe the link between them, 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 : positive, negative or zero; strong, weak or none.
- Draw a scatter diagram and a by eye through the .
- Find Pearson's with your GDC, compare it with a , and know it only measures straight-line links.
- Explain why correlation does not prove causation.
- Find the regression line with your GDC, predict with it, and interpret and in context.
- Spot unreliable predictions: , and using a on line to predict .
Before you start3 quick questions on what this builds on
Revise first: 2.1 Straight-line equations, 4.2 Data presentation and 4.3 Central tendency and dispersion
Scatter diagrams and lines of best fit
Does a town's altitude affect its summer temperature? To find out, you need two measurements from each town, kept in pairs. Data like this is .
Put the variable that might explain the other on the horizontal axis, as , and the one you want to predict on the vertical axis, as .
Describe it with two words. 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 around one, none if there is no pattern.
Try it first, then reveal one step at a time.
- Altitude might explain temperature, so it goes on the -axis. Plot the eight points.
- Direction: each time goes up, goes down, so the correlation is negative.
- Strength: the points lie very close to a straight line, so it is strong.
A straight line through the middle of the points sums up a strong trend. You can draw it by eye, but it must pass through one special point.
To draw a by eye, plot the mean point first. Rule a line through it that follows the trend, with about as many points above as below.
To find the equation of your line, read a second point off it. Then 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) Gradient from the two points: .
- Point-gradient form through the mean point: , so .
- Check with the other point: . Correct.
Pearson's correlation coefficient
Strong and weak are judgements. Pearson's puts a number on the correlation, so everyone agrees.
The sign gives the direction. means every point lies exactly on a line; means no linear correlation. As a rough guide, above about is strong, to is weak, and below there is little or none.
Your GDC finds along with the regression line (keystrokes in the regression section). By hand, which exams don't ask for, it is:
only measures how close the points are to a straight line. Data can follow a perfect curve and still have close to .
Try it first, then reveal one step at a time.
- Means: and .
- : . : .
- Products: . They add to , so .
- (b) The heights follow an exact rule, yet . The relationship is strong but not linear, so is the wrong measure here.
With few points, a fairly large can happen by chance. A , given in the question, says how large must be for pairs.
Try it first, then reveal one step at a time.
- Compare with the critical value: .
- So the correlation is significant. It is also strong and positive: taller trees tend to have thicker trunks.
Correlation is not causation
Strong correlation shows that two variables move together. It doesn't show that changing one would change the other.
Often a third variable drives both. Sometimes the link is a coincidence, more likely with few data points. So remember: correlation does not imply causation.
Try it first, then reveal one step at a time.
- (a) is positive and close to , and : strong, significant positive correlation.
- (b) Correlation doesn't show causation. Bigger towns have more houses, so more fires, and need more fire stations. Population drives both, so the data gives no evidence that closing stations would reduce fires.
Try it first, then reveal one step at a time.
- Test the correlation first: , so it is not significant: it could be chance.
- Even a significant correlation wouldn't prove the claim: keen students may use the app more and also work harder in other ways.
The regression line of y on x
Lines drawn by eye vary from person to person. The regression line is fixed by a rule.
Here is the and is the : watch the letters. Your GDC finds both.
Try it first, then reveal one step at a time.
- (a) Enter in the first list and in the second. Run linear regression (): , .
- (b) : very strong positive correlation.
- (c) Use the stored values: minutes.
Say what and mean using the question's variables and units. only has a real meaning if makes sense and is near the data.
Try it first, then reveal one step at a time.
- (a) : each extra kilometre adds about dollars to the fare, on average.
- : the predicted fare for km, like a fixed starting charge of dollars.
- (b) Each kilometre adds dollars, so more add dollars.
- Substituting would give the fare for a km trip, not the extra cost.
Making reliable predictions
Trust a prediction from the on line only if three things hold. First, the correlation is strong or significant.
Second, is inside the data, because the pattern may stop beyond it. Third, you are predicting . The of on minimises vertical distances, so to predict from use the line of on (4.10), never a rearranged one.
Mean point (x̄, ȳ) = ()
y on x:
x on y:
Pearson's r =
Drag the point off the trend of the other four and watch fall: the two lines spread apart. Drag it back along the trend and they close up. They would match only if , with every point on one line.
Try it first, then reveal one step at a time.
- (a) minutes. This is interpolation with near , so it is reliable.
- (b) km is far outside the data: extrapolation. On a much longer ride the cyclist may tire, so it is unreliable.
- (c) That rearranges the on line to predict . Use the line of on instead.
Try it first, then reveal one step at a time.
- (a) cm. Age is inside the data, so this is reasonable.
- (b) cm, which is impossible. People stop growing in their late teens, so extrapolating to age fails.
Common mistakes
- Swapping the lists on the GDC. For the line of on , goes in the first list.
- Rearranging the on line to predict from . Use the line of on .
- Substituting a data point's into the line to find its . Only the mean point must lie on the line.
- Interpreting as a value, or saying only that rises with . Say how much changes per unit of .
- Substituting to find the effect of more units. The change is .
- Claiming causation because is near . Correlation does not imply causation.
Exam tips
- Write down : read it from your GDC, no working needed, to 3 s.f. with its sign.
- Interpret, in context: use the question's variables and units, such as about minutes per extra kilometre.
- On Paper 2, write the substitution before the answer, using the stored values of and .
- Comment on reliability: say whether is inside the data range, and how strong the correlation is.
Key takeaways
Practise this
13 past-paper questions on 4.4 in the AA HL bank, each with a mark scheme and a worked explanation.