All subjects · Mathematics · WST03 Statistics 3

Spearman's rank correlation coefficient

Edexcel IAL Mathematics · WST03 Statistics 3

Spearman's rank correlation coefficient measures how closely two sets of rankings agree. It works on ranks, so it detects any steadily increasing or decreasing relationship, not only a straight-line one.

Practise this in the app: instant marking and a fix for every mistake. Free, no email needed to start.

Practise this lesson

The formula

Rank each variable separately (1 for the smallest or for the best, but the same way for both). Find d, the difference in ranks for each item, then

r_s = 1 - 6Σd2 / (n(n2 - 1)).

It lies between -1 and 1: r_s = 1 means identical rankings, r_s = -1 exactly reversed rankings. Examiners report candidates forgetting to subtract from 1.

ContestantABCDEFGH
Judge 112345678
Judge 221436857

Ranks given by two judges

Example

For the judges: d = -1, 1, -1, 1, -1, -2, 2, 1, so Σd2 = 14.0. r_s = 1 - 6 × 14.0/(8 × 63) = 1 - 84/504 = 0.8333: strong agreement between the judges.

When to use Spearman rather than the PMCC

Use Spearman's when:

The PMCC measures linear correlation of the actual values; Spearman's measures agreement of the ranks.

Tied ranks

Exam questions are not set with ties, but you should know the method: tied values share the mean of the ranks they would have occupied. Values 12, 15, 15, 18 get ranks 1, 2.5, 2.5, 4. With ties, the formula for r_s is only approximate; the exact method is to calculate the PMCC of the ranks.

Worked example

Find Spearman's rank correlation coefficient for x: 3.2, 4.1, 2.8, 5.0, 4.6, 3.9 and y: 18, 21, 15, 20, 24, 17.

  1. Ranks of x: 2, 4, 1, 6, 5, 3
  2. Ranks of y: 3, 5, 1, 4, 6, 2
  3. Σd2 = 8
  4. r_s = 1 - 6 × 8/(6 × 35)

Answer: r_s = 0.7714

Key idea: Rank both variables the same way, find Σd2, r_s = 1 - 6Σd2/(n(n2 - 1)). Spearman's measures agreement of rankings, so it suits ranked or non-linear monotonic data.

Check yourself

  1. Using the two judges' rankings, find Σd2.
    Show answer

    14. d = -1, 1, -1, 1, -1, -2, 2, 1; squares total 14.

  2. Using the two judges' rankings, find Spearman's rank correlation coefficient. Give your answer to 3 significant figures.
    Show answer

    0.833. 1 - 84/504 = 0.8333.

  3. For 10 pairs of ranks, Σd2 = 42. Find r_s. Give your answer to 3 significant figures.
    Show answer

    0.745. 1 - 252/990 = 0.7455.

  4. Find r_s for x: 3.2, 4.1, 2.8, 5.0, 4.6, 3.9 and y: 18, 21, 15, 20, 24, 17. Give your answer to 3 significant figures.
    Show answer

    0.771. Ranks give Σd2 = 8, so r_s = 1 - 48/210 = 0.7714.

  5. The values 12, 15, 15, 18 are ranked from smallest. What rank is given to each 15?
    Show answer

    2.5. The two 15s would occupy ranks 2 and 3, so each gets (2 + 3)/2 = 2.5.

  6. Five items are ranked by two judges in exactly opposite orders. Find Σd2.
    Show answer

    40. d = -4, -2, 0, 2, 4, so Σd2 = 16 + 4 + 0 + 4 + 16 = 40, giving r_s = 1 - 240/120 = -1.

  7. A scatter diagram shows y increasing with x but along a curve, not a straight line. Which coefficient is more suitable?
    • The PMCC, because it uses the actual values
    • The PMCC, because the data are not ranks
    • Neither, because there is no correlation
    • Spearman's rank, because the relationship is monotonic but not linear
    Show answer

    Spearman's rank, because the relationship is monotonic but not linear. Spearman's measures any always-increasing relationship; the PMCC only measures linear association.

  8. What does r_s = -1 tell you?
    • There is no relationship between the rankings
    • The rankings are identical
    • The two rankings are in exactly the reverse order
    • The data lie on a straight line with negative gradient
    Show answer

    The two rankings are in exactly the reverse order. Perfect disagreement: the highest on one is lowest on the other.

Practise with instant feedback

Sources

Last updated 8 November 2026. Spotted a mistake? Tell us.