AxoPrep

Mathematics: Applications and Interpretation

SL 4.10 Spearman's rank correlation

Measuring how consistently two variables rise or fall together by correlating their ranks. Study guide, 1 practice questions with markschemes and 1 flashcards. Free.

Ranking data including ties · Calculating Spearman's coefficient with technology · Pearson versus Spearman: when each is appropriate · Effect of outliers · Interpreting the result

Practise all 1 questions Study 1 flashcards

Study guide

Why ranks?

Pearson's \(r\) only measures linear relationships. Sometimes the relationship is curved but still always increasing, or the data are themselves rankings (two judges ordering contestants). Spearman's rank correlation coefficient \(r_s\) asks a simpler question: do higher values of \(x\) go with higher values of \(y\)? It measures how monotonic the relationship is.

How it is calculated

  1. Rank the \(x\)-values (1 for the smallest or for the largest; be consistent).
  2. Rank the \(y\)-values in the same direction.
  3. Calculate Pearson's correlation coefficient of the ranks. That number is \(r_s\).

On the GDC: enter the two lists of ranks and run linear regression or two-variable statistics; the \(r\) it reports is \(r_s\).

Ties

If values are equal, give each the average of the ranks they would share. Values 12, 15, 15, 20 receive ranks 1, 2.5, 2.5, 4 (the two 15s would have been 2nd and 3rd).

A useful check

When there are no ties, \(r_s = 1 - \dfrac{6\sum d^2}{n(n^2 - 1)}\), where \(d\) is the difference between paired ranks. This formula is not required but is a quick check.

Worked example

Two judges rank five singers:

SingerPQRST
Judge A12345
Judge B21435

The differences are \(-1, 1, -1, 1, 0\), so \(\sum d^2 = 4\) and \(r_s = 1 - \dfrac{6 \times 4}{5 \times 24} = 0.8\). The GDC, using the ranks as lists, gives the same 0.8. The judges agree strongly.

Interpreting \(r_s\)

Describe strength with the same words used for Pearson (weak, moderate, strong) and always in context.

Pearson or Spearman?

SituationBetter choice
Points lie roughly on a straight linePearson
Curved but always increasing or decreasingSpearman
Data are already ranks or ordinal gradesSpearman
An extreme outlier is presentSpearman is less affected

For example, \(y = x^3\) on positive \(x\) gives \(r_s = 1\) but Pearson's \(r\) below 1, since the points are not on a line.

Effect of outliers

An outlier can drag Pearson's \(r\) a long way because it uses the actual distances. With ranks, the most extreme value just becomes rank \(n\), so its influence is limited.

Common mistakes

Exam tips

Cheat sheet

Key definitions

Rank

The position of a value when the data are put in order.

Spearman's rank correlation coefficient

Pearson's correlation coefficient calculated on the ranks of the data, written r_s.

Monotonic relationship

A relationship in which one variable always increases, or always decreases, as the other increases.

Tied ranks

Equal values given the mean of the ranks they occupy.

Ordinal data

Data that can be ordered but whose gaps are not necessarily meaningful, such as placings.

Practice questions

SLPaper 2Challenging

Question 1

Two judges scored six contestants in a dance competition.

ContestantPQRSTU
Judge 17.28.56.19.07.85.5
Judge 26.88.96.58.17.05.9
(a) [2]

Rank the contestants for each judge, giving rank 1 to the highest score.

Markscheme
  • 1 Judge 1: P 4, Q 2, R 5, S 1, T 3, U 6
  • 1 Judge 2: P 4, Q 1, R 5, S 2, T 3, U 6
(b) [2]

Calculate Spearman's rank correlation coefficient, \(r_s\).

Markscheme
  • 1 Pearson's \(r\) on the ranks, or \(\sum d^2 = 2\) with \(1 - \frac{6 \times 2}{6(36 - 1)}\)
  • 1 \(r_s = 0.943\) (0.94285...)
(c) [1]

Interpret your value of \(r_s\) in context.

Markscheme
  • 1 Strong agreement between the judges' rankings (strong positive association)

Key facts

When should you use Spearman's \(r_s\) instead of Pearson's \(r\)?

When the relationship is monotonic but not linear, when data are ranks, or when outliers distort Pearson's \(r\).