Rank correlation: Spearman and Kendall
Spearman's ρ and Kendall's τ-b measure monotone association using ranks, so they resist outliers and do not require a straight line.
- Spearman's ρ: Pearson's r computed on the ranks
- ranks 1…n of x, tied values sharing their average rank
- numbers of concordant and discordant pairs of observations
- total number of pairs
- pairs tied in x and pairs tied in y (both 0 without ties)
When to use
- The relationship is monotone (always rising or always falling) but not necessarily linear.
- Ordinal data (ratings, rankings) or data with outliers or strong skew.
Assumptions
- Independent pairs. No distributional assumption for the coefficients themselves.
- The engine tests Spearman's ρ with the t approximation (approximate for small n); Kendall's τ-b uses the exact null distribution when there are no ties and n is small, otherwise a tie-corrected normal approximation.
How to interpret
- Both range from −1 to 1; ±1 means a perfectly monotone relationship.
- Kendall's τ has a direct reading: (without ties) is P(a random pair is concordant) − P(discordant).
- τ is usually smaller in size than ρ for the same data; do not compare one with the other.
Common mistakes
- Treating rank correlation as a test of linearity; it ignores the spacing of values.
- Comparing Spearman's ρ from one study with Pearson's r or Kendall's τ from another.
- Forgetting that a monotone association is still not causation.
Example
Two judges rank five entries: x = 1, 2, 3, 4, 5 and y = 2, 1, 4, 3, 5.
- Spearman: (t = 2.31, 3 df, p = 0.104).
- Kendall: 10 pairs, C = 8 concordant, D = 2 discordant, so , exact p = 0.233.
- With only five entries, neither is clear evidence of agreement beyond chance.