Spearman's rank correlation coefficient
Studying this course? Keep your progress in one place.
Key facts
- measures agreement between the ranks of two variables, from to .
- Rank both variables in the same direction; tied values get the mean of their ranks.
- , where is the difference in ranks.
- It suits ranked data and monotonic relationships, and is less affected by outliers.
- A strong does not show that one variable causes the other.
What it measures
How well the ranks of one variable agree with the ranks of another.
Spearman's rank correlation coefficient, , takes values from to . means identical rankings, means one is the exact reverse of the other, and near means no consistent agreement.
Use it when the data are already ranks, when the relationship is monotonic (always increasing or always decreasing) but not necessarily linear, or when the data are not bivariate Normal.
Which situation is best suited to Spearman's coefficient?
Ranking the data
Use the same direction for both variables, and give ties the mean rank.
Rank each variable separately, using the same direction for both (rank 1 for the largest in both, or for the smallest in both). Either direction is fine as long as it is the same.
If two or more values are equal, give each the mean of the ranks they would have occupied: equal values in 4th and 5th place each get rank , and the next value is 6th. These are tied ranks.
- 1
Order
Each variable separately
- 2
Rank
Same direction for both
- 3
Ties
Give each the mean rank
Two equal values would occupy 4th and 5th place. What rank does each get?
Calculating
Find the difference in ranks for each pair, then use the formula.
Find for each pair, then ; is the number of pairs. The difference in ranks can be positive or negative.
Check: must be , and with no ties is always even.
- 1
Find each d
d = −1, 1, −1, 1, 0, and the sum is 0 as it should be
- 2
Sum the squares
Σd² = 1 + 1 + 1 + 1 + 0 = 4
- 3
Use the formula
r_s = 1 − (6 × 4)/(5 × 24) = 0.8
- Spearman's coefficient
Worked example
Six dancers are ranked by two judges. The differences in ranks are . Find .
- 1
Check: .
- 2
Square and add: .
- 3
Substitute with : .
For and , what is ?
Interpreting and limitations
Interpret in context, and remember it uses only order and does not show cause.
near means items ranked high on one tend to be ranked high on the other; near , high on one means low on the other; near , little agreement. Reversing one ranking changes the sign but not the size.
Correlation is not causation. uses only order, so it ignores how far apart values are, and a rise-then-fall relationship can give near . With small it is unreliable.
| Spearman's | Product moment | |
|---|---|---|
| Data used | Ranks only | Actual values |
| Outliers | Less affected | Strongly affected |
| Relationship measured | Monotonic | Linear |
| Assumption | No bivariate Normal needed | Bivariate Normal |
Spearman's
- Data used:
- Ranks only
- Outliers:
- Less affected
- Relationship measured:
- Monotonic
- Assumption:
- No bivariate Normal needed
Product moment
- Data used:
- Actual values
- Outliers:
- Strongly affected
- Relationship measured:
- Linear
- Assumption:
- Bivariate Normal
Which is an advantage of Spearman's coefficient over the product moment coefficient?
Try an exam question
Two judges rank seven skaters. The sum of the squares of the differences in ranks is . (a) Calculate Spearman's rank correlation coefficient. (b) Interpret your value.
[4 marks]
- [1].
- [1].
- [1]There is strong positive correlation between the two sets of ranks.
- [1]The judges broadly agree: skaters ranked high by one tend to be ranked high by the other.
That's the notes covered.
Carry on to the next subtopic.
Try a question
Find , where is the difference between the two ranks given to a dancer.
1 mark, marked against the mark scheme
Find , where is the difference between the two ranks given to a dancer.
1 mark, marked against the mark scheme