Year 3 · Notes: Organising, Representing and Interpreting Data – Correlation and Regression
Topic: S.S1 Y3 ORGANISING, REPRESENTING AND INTERPRETING DATA
Univariate and bivariate data, scatter diagrams, the type and strength of correlation, Pearson's and Spearman's correlation coefficients, the regression line, making predictions and the difference between correlation and cause.
Year 3 · Notes: Organising, Representing and Interpreting Data – Correlation and Regression
Do students who study longer score higher? Do farms that use more fertiliser harvest more maize? Does a car lose value as it gets older? Each question links two measurements taken from the same thing. Year 3 statistics studies such pairs: how to picture the link, how to measure its strength with one number, and how to use it to make predictions.
IN THIS NOTE
Univariate and bivariate data.
Scatter diagrams and the line of best fit.
Positive, negative and no correlation; strong and weak correlation.
Pearson's product-moment and Spearman's rank correlation coefficients.
The least squares regression line and predictions.
Interpolation and extrapolation; correlation is not causation.
1. Bivariate data and scatter diagrams
Univariate data record one variable (the heights of students). Bivariate data record two variables for each member (the height and mass of each student). We plot bivariate data as points on a scatter diagram, with the explanatory variable (the one you think may influence the other) on the \(x\)-axis.
If the points slope upwards, there is positive correlation: as one variable increases, so does the other. If they slope downwards, negative correlation. If there is no pattern, no correlation. The closer the points are to a straight line, the stronger the correlation.
A line of best fit drawn by eye should follow the trend with roughly equal numbers of points on each side, and pass through the mean point \((\bar{x}, \bar{y})\).
2. Correlation coefficients
A correlation coefficient measures the strength of a straight-line relationship with one number between \(-1\) and \(+1\): \(+1\) is perfect positive, \(-1\) is perfect negative, and 0 means no linear correlation.
Pearson's product-moment correlation coefficient uses the actual values: \[r = \frac{S_{xy}}{\sqrt{S_{xx}S_{yy}}}, \quad S_{xy} = \sum xy - n\bar{x}\bar{y},\ S_{xx} = \sum x^2 - n\bar{x}^2,\ S_{yy} = \sum y^2 - n\bar{y}^2.\]
Spearman's rank correlation coefficient uses only the ranks (1st, 2nd, …), so it suits ordered data such as judges' rankings: \[r_s = 1 - \frac{6\sum d^2}{n(n^2 - 1)},\] where \(d\) is the difference between the two ranks of each item.
Value of r | Interpretation |
|---|---|
\(0.7\) to \(1\) | strong positive |
\(0.3\) to \(0.7\) | moderate positive |
\(-0.3\) to \(0.3\) | weak or no linear correlation |
\(-0.7\) to \(-0.3\) | moderate negative |
\(-1\) to \(-0.7\) | strong negative |
WORKED EXAMPLE · Spearman's rank
Six students are ranked in Maths and Physics:
Student | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
Maths rank | 1 | 2 | 3 | 4 | 5 | 6 |
Physics rank | 2 | 1 | 4 | 3 | 6 | 5 |
\(d\) | −1 | 1 | −1 | 1 | −1 | 1 |
\(d^2\) | 1 | 1 | 1 | 1 | 1 | 1 |
\(\sum d^2 = 6\), so \(r_s = 1 - \dfrac{6 \times 6}{6(36 - 1)} = 1 - \dfrac{36}{210} \approx 0.83\): a strong positive agreement between the two rankings.
3. The regression line
The least squares regression line of \(y\) on \(x\) is the straight line that makes the total of the squared vertical distances from the points as small as possible: \[y = a + bx, \qquad b = \frac{S_{xy}}{S_{xx}}, \qquad a = \bar{y} - b\bar{x}.\] It always passes through \((\bar{x}, \bar{y})\). The gradient \(b\) tells you how much \(y\) changes, on average, for each extra unit of \(x\).
WORKED EXAMPLE · Hours of study and test scores
Hours \(x\): 1, 2, 3, 4, 5. Scores \(y\): 52, 55, 61, 64, 68.
\(\bar{x} = 3\), \(\bar{y} = 60\), \(\sum xy = 941\), \(\sum x^2 = 55\), \(\sum y^2 = 18\,170\). So \(S_{xy} = 941 - 900 = 41\), \(S_{xx} = 55 - 45 = 10\), \(S_{yy} = 18\,170 - 18\,000 = 170\).
\(b = \tfrac{41}{10} = 4.1\), \(a = 60 - 4.1(3) = 47.7\). Regression line: \(y = 47.7 + 4.1x\). Each extra hour of study goes with about 4 more marks.
\(r = \dfrac{41}{\sqrt{10 \times 170}} \approx 0.99\): a very strong positive correlation. For 3.5 hours the predicted score is \(47.7 + 4.1(3.5) \approx 62\).
WATCH OUT
Predicting inside the range of the data (interpolation) is fairly reliable. Predicting outside it (extrapolation) is risky: the line gives 88.7 marks for 10 hours of study, but the pattern may not continue that far.
KEY IDEA
Correlation does not prove cause. Ice-cream sales and drowning cases both rise in hot weather; ice cream does not cause drowning. A third factor (here, temperature) may drive both.
Check yourself
Additional Mathematics
Senior High
More on ORGANISING, REPRESENTING AND INTERPRETING DATA
Other resources you can find on TudHub.