Maths › Practise › Questions › Correlation coefficients: product moment and Spearman
Questions on correlation coefficients: product moment and Spearman
The product moment correlation coefficient measures how close a set of points lies to a straight line; Spearman's rank coefficient measures only how far the two orderings agree. Both take values between −1 and 1, and they answer different questions.
16 original questions · 64 marks · the correlation coefficients: product moment and Spearman notes · Further Statistics 2
To print: the questions (PDF, 84 KB) · the worked answers (PDF, 99 KB)
These are original InkMaths questions. Write a complete answer before opening the worked solution and marking guidance.
State what the product moment correlation coefficient measures and the range of values it can take.
Worked solution and marking guidance
It measures the strength and direction of the linear association between two variables, and always lies between −1 and 1 inclusive. B1 for the strength and direction of linear association, B1 for the range −1 to 1. Values at the ends mean the points lie exactly on a straight line, falling or rising; zero means no linear association, which is not the same as no relationship.A data set gives Sxx = 40, Sxy = 58 and Syy = 86. Find r and interpret it.
Worked solution and marking guidance
r = 58/√(40 × 86) = 58/√3440 = 58/58.65 = 0.989 to three decimal places. That is very strong positive linear correlation, so the points lie almost exactly on a rising straight line. M1 for the formula, A1 for 0.989, B1 for the interpretation.State two conditions the data must satisfy before the product moment correlation coefficient is the appropriate measure to quote.
Worked solution and marking guidance
Both variables must be measured on a numerical scale, and the association being described must be a linear one, since that is all r reports: a scatter diagram should be drawn and should show points scattered about a straight line rather than a curve, and no single extreme point should be driving the value. B1. If the coefficient is then to be tested against tabulated critical values, the pairs must come from a population with a bivariate normal distribution. B1.
Where the data are ranks, or the relationship is monotonic but curved, Spearman's coefficient is the measure that fits instead.Eight pairs of readings give Σx = 40, Σx² = 240, Σy = 96, Σy² = 1224 and Σxy = 520. Find Sxx, Syy and Sxy.
Worked solution and marking guidance
Each correction term divides by n = 8.
Sxx = 240 − 40²/8 = 240 − 200 = 40.
Syy = 1224 − 96²/8 = 1224 − 1152 = 72.
Sxy = 520 − (40)(96)/8 = 520 − 480 = 40.
M1 for the three formulas, A1 for two correct values, A1 for all three. These three feed r = 40/√(40 × 72) = 0.745, so an error in any one of them travels the whole way to the coefficient.Each x value is coded as u = (x − 20)/5 and each y as v = (y − 100)/10. Explain the effect on r, and on the gradient of the regression line of y on x.
Worked solution and marking guidance
Coding by a shift and a positive scale factor leaves r unchanged, because the scatter is only translated and stretched, so its straightness is untouched. The gradient does change. If the regression of v on u has gradient B, then b = B × (10/5) = 2B, since y varies ten units for every one of v and x five for every one of u. B1 for r unchanged, B1 for the reason, M1 for relating the two gradients, A1 for b = 2B. A negative scale factor on exactly one variable would flip the sign of r.Two coaches rank seven players. Coach A gives 1 to 7 in order; coach B gives 1, 3, 2, 5, 4, 7, 6. Calculate Spearman's rank correlation coefficient.
Worked solution and marking guidance
The differences are 0, −1, 1, −1, 1, −1, 1, so Σd² = 0 + 1 + 1 + 1 + 1 + 1 + 1 = 6. With n = 7, n(n² − 1) = 7 × 48 = 336, so rs = 1 − 36/336 = 1 − 0.1071 = 0.893. M1 for the differences, A1 for Σd² = 6, M1 for the formula, A1 for 0.893. The two rankings agree closely.Six items are ranked, and two of them tie for third place. Explain how the ranks are assigned, and calculate rs if the resulting Σd² is 8.
Worked solution and marking guidance
Tied items share the average of the ranks they would have occupied, so two tying for third and fourth both take rank 3.5, and the next item takes rank 5. With n = 6, n(n² − 1) = 6 × 35 = 210, so rs = 1 − 48/210 = 0.771. B1 for the shared rank of 3.5, M1 for the formula, A1 for 0.771. With ties present the formula is an approximation; the product moment coefficient applied to the ranks is exact.Five students record their revision hours x and their test scores y. The totals are Σx = 25, Σy = 50, Σxy = 331, Σx² = 185 and Σy² = 635. Calculate the product moment correlation coefficient.
Worked solution and marking guidance
Build the three summary statistics first. Sxy = 331 − (25)(50)/5 = 331 − 250 = 81, Sxx = 185 − 25²/5 = 60 and Syy = 635 − 50²/5 = 135. M1 for the S formulas, A1 for all three values. Then r = 81/√(60 × 135) = 81/√8100 = 81/90 = 0.9. M1 for the formula, A1 for 0.9. Divide by n in each correction term; omitting it distorts all three S values at once; an r outside −1 to 1 is the sign to go back and look.Eight competitors are placed by two judges. The first judge gives the ranks 1 to 8 in order. The second gives 2, 1, 4, 3, 6.5, 5, 6.5 and 8, having placed two competitors equal. Explain how the rank 6.5 arose, and calculate Spearman's rank correlation coefficient.
Worked solution and marking guidance
Two competitors could not be separated for sixth and seventh place, so they share the average of the ranks they would have occupied: (6 + 7)/2 = 6.5 each, and the next competitor takes rank 8. B1.
The differences d are −1, 1, −1, 1, −1.5, 1, 0.5 and 0, so d² gives 1, 1, 1, 1, 2.25, 1, 0.25 and 0, and Σd² = 7.5. M1 for the differences, A1 for 7.5.
With n = 8, n(n² − 1) = 8 × 63 = 504, so rs = 1 − 6(7.5)/504 = 1 − 45/504 = 0.911 to three decimal places. A1.
Check the second judge's ranks before starting: they total 36, which is 1 + 2 + … + 8, as any complete ranking must. With ties present the formula is an approximation, and the product moment coefficient applied to the ranks themselves is the exact value.Nine pairs of readings are coded as u = x − 30 and v = (y − 200)/4. The coded totals are Σu = 18, Σu² = 96, Σv = −9, Σv² = 171 and Σuv = 60. Calculate the product moment correlation coefficient between x and y.
Worked solution and marking guidance
Work in the coded variables throughout.
Suu = 96 − 18²/9 = 96 − 36 = 60. Svv = 171 − (−9)²/9 = 171 − 9 = 162. Suv = 60 − (18)(−9)/9 = 60 + 18 = 78. M1 for the three formulas, A1 for all three values. The correction term for Suv is a negative product being subtracted, so it adds.
r = 78/√(60 × 162) = 78/√9720 = 78/98.59 = 0.791. M1 for the formula, A1 for 0.791.
The coding shifted both variables and scaled y by a positive factor, and neither operation bends the scatter, so r is unchanged: 0.791 is the coefficient between x and y as well as between u and v. B1.
A negative scale factor on one variable alone would reverse the sign of r, so check the sign of each scale factor before quoting the coded value as the answer.Six students sat two papers, and their marks (paper 1, paper 2) were (32, 41), (45, 52), (28, 35), (50, 61), (39, 44) and (44, 55). Calculate the product moment correlation coefficient between the two papers' marks.
Worked solution and marking guidance
Build the five sums first: Σx = 238, Σy = 288, Σx² = 9790, Σy² = 14292 and Σxy = 11818. M1.
Sxx = 9790 − 238²/6 = 349.33, Syy = 14292 − 288²/6 = 468, Sxy = 11818 − (238)(288)/6 = 394. A1 for all three.
r = 394/√(349.33 × 468) = 394/404.34 = 0.974. M1 for the formula, A1 for 0.974.
That is very strong positive linear correlation: students who did well on paper 1 did well on paper 2. Keep Sxx as 349.33 rather than rounding it to 349, since the coefficient is quoted to three decimal places and the rounding reaches the third of them.A colony is counted at six equally spaced times. The counts, in order, are 2, 3, 5, 9, 17 and 33, at times 1, 2, 3, 4, 5 and 6. Calculate the product moment correlation coefficient and Spearman's rank correlation coefficient, and explain why they differ so much.
Worked solution and marking guidance
Product moment. With n = 6, Σx = 21, Σy = 69, Σxy = 342, Σx² = 91 and Σy² = 1497.
Sxy = 342 − (21)(69)/6 = 342 − 241.5 = 100.5. Sxx = 91 − 441/6 = 17.5. Syy = 1497 − 4761/6 = 703.5.
r = 100.5/√(17.5 × 703.5) = 100.5/110.96 = 0.906. Set the five sums out before substituting; a single wrong total carries through to the coefficient.
Spearman. The counts increase throughout, so ranking them 1 to 6 gives exactly the same order as the times. Every d is zero, so Σd² = 0 and rs = 1 − 0 = 1.
Why they differ. The relationship is a perfect increasing one, which is all that Spearman's coefficient asks about, so it returns its maximum. The product moment coefficient asks whether the points lie on a straight line, and these lie on a curve that steepens sharply, so it falls short of 1. M1 for Sxy, Sxx and Syy, A1 for r = 0.906, M1 for ranking the counts, A1 for the Spearman value of 1, B1 for Spearman needing only a monotonic relationship, B1 for the product moment coefficient measuring straightness.
A value of r near zero would not even rule out a relationship; the points (−2, 4), (−1, 1), (0, 0), (1, 1), (2, 4) give r = 0 while y is exactly x².Nineteen readings of two variables show no pattern at all, but a twentieth sits far above and far to the right of the rest, and with it included r = 0.91. Explain why the coefficient is so large, and why Spearman's coefficient would resist the same distortion.
Worked solution and marking guidance
The product moment coefficient is built from distances to the means, so a single extreme point contributes an enormous product to Sxy and drags the coefficient a long way on its own: the 0.91 describes one reading, not an association in the other nineteen. B1 for the outlier doing the work. Spearman's coefficient replaces every value by its rank, and ranking caps the stranger's influence: however far out it sits, it is only rank 20, one step beyond rank 19. B1 for ranks discarding the distances. The scatter should be drawn before either coefficient is quoted, and here it would show nineteen patternless points and one stray reading. B1 for the plot as the check. The price Spearman pays is that it throws away the sizes of the gaps even when they are honest.Two judges rank the same n items, and their rankings are exactly opposite: where the first judge gives rank i, the second gives rank n + 1 − i. Show that Σd² = n(n² − 1)/3, and hence that Spearman's rank correlation coefficient is −1.
Worked solution and marking guidance
For the item the first judge ranks i, the difference is d = i − (n + 1 − i) = 2i − n − 1. M1 for d in terms of i.
Squaring and summing over i from 1 to n:
Σd² = Σ(4i² − 4(n + 1)i + (n + 1)²) = 4Σi² − 4(n + 1)Σi + n(n + 1)². M1 for expanding and splitting the sum.
Using Σi = n(n + 1)/2 and Σi² = n(n + 1)(2n + 1)/6:
Σd² = (2/3)n(n + 1)(2n + 1) − 2n(n + 1)² + n(n + 1)². A1 for the standard sums substituted.
The last two terms combine to −n(n + 1)², so Σd² = n(n + 1)[(2(2n + 1) − 3(n + 1))/3] = n(n + 1)(n − 1)/3 = n(n² − 1)/3. A1.
Substituting into rs = 1 − 6Σd²/[n(n² − 1)] gives 1 − 6[n(n² − 1)/3]/[n(n² − 1)] = 1 − 2 = −1. M1 for the substitution, A1 for −1.
Check it on a small case: with n = 5 the rankings 1, 2, 3, 4, 5 against 5, 4, 3, 2, 1 give d = −4, −2, 0, 2, 4 and Σd² = 40, which is 5 × 24/3.The n points (x₁, y₁), …, (xn, yn) all lie exactly on the line y = a + bx, where b > 0 and the x values are not all equal. Show that the product moment correlation coefficient of the data is 1, and state its value when b < 0.
Worked solution and marking guidance
Since every point satisfies y = a + bx, the mean point does too: ȳ = a + bx̄. Subtracting, y − ȳ = b(x − x̄) for every point. M1 for the deviations of y written as b times those of x.
Sxy = Σ(x − x̄)(y − ȳ) = Σ(x − x̄)·b(x − x̄) = bSxx. A1.
Syy = Σ(y − ȳ)² = Σb²(x − x̄)² = b²Sxx. A1.
So
r = Sxy/√(SxxSyy) = bSxx/√(b²Sxx²) = bSxx/(|b|Sxx) = b/|b|. M1 for substituting into the formula.
With b > 0 that is 1, and with b < 0 it is −1. A1 for both values with the sign of b as the reason.
Note that Sxx cancels completely, so the value of r says nothing whatever about how steep the line is or how far apart the points are along it: r = 1 for y = 2 + 0.01x and for y = 2 + 100x alike. The condition that the x values are not all equal is what keeps Sxx non-zero and the coefficient defined.The table gives, for each of eight members of a choir, the number of hours x spent practising during one week and the score y, out of 80, awarded at an audition at the end of that week. Rank each of the two sets of values, and calculate Spearman's rank correlation coefficient for these data, explaining how you deal with the tied values.
member hours of practice x audition score y A 12 68 B 5 45 C 9 60 D 14 74 E 7 52 F 9 55 G 3 40 H 11 70 Worked solution and marking guidance
Rank each variable separately, giving rank 1 to the smallest value. Putting the practice hours in order gives 3, 5, 7, 9, 9, 11, 12, 14, so G takes rank 1, B rank 2 and E rank 3, then C and F tie, then H, A and D follow. M1 for ordering a variable and assigning ranks to it. Tied values take the mean of the ranks they would have occupied, so C and F each take (4 + 5)/2 = 4.5 and the next member along takes rank 6, not rank 5; the ranks still add to the same total as 1 to 8. B1 for the tie rule and its effect on the ranks that follow. The practice ranks are therefore A 7, B 2, C 4.5, D 8, E 3, F 4.5, G 1, H 6, and the score ranks, which have no ties, are A 6, B 2, C 5, D 8, E 3, F 4, G 1, H 7. A1 for both sets of ranks. The differences d, taken in the same order A to H, are 1, 0, −0.5, 0, 0, 0.5, 0 and −1, and their squares are 1, 0, 0.25, 0, 0, 0.25, 0 and 1. M1 for the differences and their squares. The sum of the d² values is 2.5. A1 for 2.5. With n = 8, n(n² − 1) = 8 × 63 = 504, so rs = 1 − 6 × 2.5/504 = 1 − 15/504 = 1 − 0.0298 = 0.970 to 3 significant figures. A1 for 0.970. A value this close to 1 says the audition placed the eight members in very nearly the order their practice hours did. Only two pairs disagree at all: A and H change places, and C, tied with F on hours, was scored above F.
All questions, worked solutions and marking guidance are original InkMaths material. They are not copied from awarding-body papers or mark schemes. The codes show how InkMaths allocates the stated total; an awarding body may credit a valid alternative method differently.
The same practice on paper: the printable workbook for this topic, with the questions and a worked answer book.
Practise correlation coefficients: product moment and Spearman one question at a time
In the player, mark your own response after viewing the worked solution. Your score decides when the question is offered again.