Skip to content

Mathematics and Statistics · Ch 14 — Correlation

Spearman's Rank Correlation Coefficient

4

Spearman's Rank Correlation Coefficient

Sometimes the data are not exact measurements but ranks — the order in which judges place competitors, or the positions of students in two subjects. Sometimes the characteristic (beauty, honesty, efficiency) cannot be measured numerically at all, only ranked. For such data the British psychologist Charles Spearman gave a coefficient based only on the ranks, called the rank correlation coefficient, denoted RR (or rsr_s).

When there are no repeated ranks (no ties):

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

where di=R1i−R2id_i = R_{1i} - R_{2i} is the difference between the two ranks of the ii-th individual and nn is the number of individuals. Like Pearson's rr, RR lies between −1-1 and +1+1.

Steps: (i) rank each variable separately (say, largest value gets rank 1 — be consistent for both variables); (ii) find d=R1−R2d = R_1 - R_2 for each pair; (iii) square and total to get ∑d2\sum d^2; (iv) substitute in the formula. As a check, ∑d\sum d must always equal 00.

When ranks are repeated (tied ranks): each set of tied values is given the average of the ranks they would occupy, and a correction term is added for every tie. If a value is repeated mm times, the correction is m(m2−1)12\dfrac{m(m^2 - 1)}{12}, and the formula becomes

R=1−6[∑d2+∑m(m2−1)12]n (n2−1),R = 1 - \frac{6\left[\sum d^2 + \sum \dfrac{m(m^2 - 1)}{12}\right]}{n\,(n^2 - 1)},

the inner sum running over every tied group in both variables.

Tip

Pearson or Spearman? …

Definition 1Rank correlation ($R$)

Correlation computed from the ranks of the observations rather than their actual values: R=1−6∑d2n(n2−1)R = 1 - \dfrac{6\sum d^2}{n(n^2-1)} …

Definition 2Tie correction

The term m(m2−1)12\dfrac{m(m^2-1)}{12} added to ∑d2\sum d^2 for each group of mm equal (tied) values, whose common rank is the average of the ra …