Two variables: scatter plots, correlation and a line of best fit
A scatter plot shows two variables together, one dot for each pupil. The example has hours of study (1 to 6) and quiz marks: (1, 42), (2, 55), (3, 62), (4, 68), (5, 73), (6, 72). The dots rise from left to right, so the marks tend to rise with the hours. The correlation coefficient r measures how well the dots follow a straight line, from −1 to 1. Near 1: the two rise together. Near −1: one rises as the other falls. Near 0: no straight-line link. For these data r is about 0.94. Correlation is not causation: ice-cream sales and sunburn rise together because both depend on hot weather, not because one causes the other. A cross tabulation counts two categories at once, for instance how many pupils walk or take a bus in each year group. A regression line is the straight line closest to the dots; the least squares method chooses the line with the smallest total of squared gaps between the dots and the line. For these data it is mark = 6 × hours + 41. We may predict inside the range of the data: for 3 hours, 6 × 3 + 41 = 59. We should not predict far outside it: the line says 10 hours gives 101 marks, which is impossible.
| Pair of variables | Typical r | Meaning |
|---|---|---|
| hours of study, marks | +0.9 | rise together |
| sleep lost, alertness | −0.9 | one rises, the other falls |
| shoe size, quiz mark | 0 | no straight-line link |
| Year A | Year B | Total | |
|---|---|---|---|
| walk | 8 | 6 | 14 |
| bus | 7 | 9 | 16 |
| total | 15 | 15 | 30 |
Using mark = 6 × hours + 41, predict the mark for 2 hours and for 5 hours. Then explain why you would not use the line for 12 hours. Finally invent two variables that rise together but where one does not cause the other.