Spearman's Rank Correlation
Spearman's rank correlation coefficient, $r_s$, measures how well two sets of rankings agree. It is useful when data is already in ranks (such as judges' placings) or when a relationship is not linear.
Key points
- Rank each variable separately, using the same direction for both (e.g. largest $= 1$).
- For each item find $d$, the difference between its two ranks, then $d^2$.
- $r_s = 1 - \frac{6\sum d^2}{n(n^2 - 1)}$, where $n$ is the number of pairs.
- $r_s$ is between $-1$ and $1$: close to $1$ means strong agreement, close to $-1$ strong disagreement, close to $0$ no correlation.
- Check: $\sum d$ should always be $0$.
Worked example
Question. Two judges rank five singers. Judge 1: 1, 2, 3, 4, 5. Judge 2: 2, 1, 4, 3, 5. Find $r_s$.
- $d$: $-1, 1, -1, 1, 0$, so $d^2$: $1, 1, 1, 1, 0$ and $\sum d^2 = 4$.
- $r_s = 1 - \frac{6 \times 4}{5(25 - 1)} = 1 - \frac{24}{120}$
- $= 0.8$
Answer. 0.8 — strong agreement between the judges
Common mistakes
- Ranking one variable from largest and the other from smallest.
- Using $\sum d$ instead of $\sum d^2$ in the formula.
- Forgetting the “1 −” at the start, or using $n^2$ instead of $n(n^2 - 1)$.