Question
Mathematics
How do tied ranks affect a Spearman correlation calculation?
Answer
Mathematics
Expert Answer
Give tied observations the average of the ranks they would have occupied, then calculate Pearson correlation between the two rank lists. This gives Spearman's rank correlation with ties handled correctly.
Assign ranks to a paired data set
Consider the following made-up data for six athletes, showing how many push-ups and pull-ups each completed. Rank each variable from smallest to largest while keeping each athlete's pair together.
| Athlete | Push-ups | Pull-ups | Push-up rank | Pull-up rank |
|---|---|---|---|---|
| A | 10 | 2 | 1 | 1 |
| B | 20 | 3 | 2.5 | 2 |
| C | 20 | 5 | 2.5 | 4 |
| D | 30 | 4 | 4 | 3 |
| E | 40 | 6 | 5 | 5 |
| F | 50 | 7 | 6 | 6 |
The two scores of 20 occupy positions 2 and 3, so both receive . The next rank is 4, not 3. More generally, average every position covered by a tied group.
Ranking from largest to smallest instead gives the same value of , provided both variables are ranked in the same direction.
Correlate the ranks
In an IB exam, use your GDC: enter the two rank lists and find their Pearson correlation coefficient. This value is Spearman's rank correlation coefficient. For these ranks the GDC gives
Do not run ordinary correlation on the original push-up and pull-up counts if the question asks for Spearman correlation. The calculation must use the ranks.
If you want to see what the GDC is doing, it applies Pearson's formula to the ranks:
You will not need to calculate this by hand in an exam.
A formula you may see elsewhere
Some textbooks and websites give the formula
where is the difference between each pair of ranks. This formula is not in the IB formula booklet, and it assumes there are no ties. Here it would give exactly 0.9, close to but not the same as the correct value of 0.899. With more ties, the difference can be larger. Calculating Pearson correlation on the average ranks, as above, gives the correct value however many ties there are.
Interpreting the result
The positive result indicates that higher push-up counts generally accompany higher pull-up counts in this small sample. It does not show that practising one caused improvement in the other. Spearman measures monotonic association: whether one variable tends to rise or fall as the other rises. It does not establish a particular linear, exponential or other functional relationship.
For more practice with tied ranks, work through the athletes' push-up and pull-up question in AI SL Mock Exam, Set 1, Paper 1. Rank in the direction the question uses, average the ranks for tied scores, and keep each athlete's observations together as you calculate the association.
Answered by Revision Village IB Expert
Explore More IB Mathematics Resources
Over 80% of IB students globally are experiencing the power of Revision Village