IB

View all Questions

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.

AthletePush-upsPull-upsPush-up rank RRPull-up rank SS
A10211
B2032.52
C2052.54
D30443
E40655
F50766

The two scores of 20 occupy positions 2 and 3, so both receive (2+3)/2=2.5(2+3)/2=2.5. 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 rsr_s, 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

rs≈0.899r_s\approx0.899

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:

rs=∑(Ri−Rˉ)(Si−Sˉ)∑(Ri−Rˉ)2∑(Si−Sˉ)2=15.517×17.5≈0.899r_s=\frac{\sum(R_i-\bar R)(S_i-\bar S)}{\sqrt{\sum(R_i-\bar R)^2\sum(S_i-\bar S)^2}}=\frac{15.5}{\sqrt{17\times17.5}}\approx0.899

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

1−6∑di2n(n2−1),1-\frac{6\sum d_i^2}{n(n^2-1)},

where did_i 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

Interested in diving deeper into this concept?

Explore More IB Mathematics Resources

Over 80% of IB students globally are experiencing the power of Revision Village