- Spearman’s rank correlation \(r_s\) measures how well two variables move together in a monotonic way (always up, or always down), using ranks instead of raw values.
- Formula without ties: \(r_s = 1 – \dfrac{6\sum d^2}{n(n^2 – 1)}\), where \(d\) is the difference in ranks.
- Use it for ordinal data, skewed data, outliers, or curved but one-directional relationships.
- Test significance by comparing \(r_s\) with a critical value for your sample size.
- Below: a full worked example, how to handle ties, and exam questions with answers.
The problem: Pearson’s r doesn’t always fit
Pearson’s correlation coefficient assumes a straight-line relationship between two numerical variables, and it is pulled around by outliers. But a lot of real data is not like that. Judges rank contestants. Survey answers run from “strongly disagree” to “strongly agree”. Income is heavily skewed. Sometimes the relationship is clearly one-directional but curved. In all these cases you want Spearman’s rank correlation coefficient, named after the psychologist Charles Spearman, who introduced it in 1904[1]. It appears in Cambridge 9709 Statistics, IB Mathematics, A-level Geography and Biology fieldwork, and many dissertations.
Key ideas
When there are no tied ranks, Pearson’s formula on the ranks simplifies to
where \(d\) is the difference between each pair of ranks and \(n\) is the number of pairs.
Worked example
Eight students recorded how many hours they revised and their exam mark (%). Is there a significant positive association at the 5% level?
Hours: 12, 5, 8, 15, 3, 10, 7, 14
Marks: 72, 60, 70, 85, 55, 64, 58, 80
Hours ranks: 6, 2, 4, 8, 1, 5, 3, 7
Marks ranks: 6, 3, 5, 8, 1, 4, 2, 7
Conclusion: there is strong evidence of a positive association between revision hours and exam marks among these students. Correlation is not causation, though: students who revise more may also attend more lessons.
| n | 5% one-tailed | 5% two-tailed |
|---|---|---|
| 6 | 0.829 | 0.886 |
| 8 | 0.643 | 0.738 |
| 10 | 0.564 | 0.648 |
| 12 | 0.503 | 0.587 |
These are standard critical values for Spearman’s coefficient[2]. Your exam board’s formula book has the full table; use it, because published tables differ slightly in rounding.
What to do with tied ranks
If two values are equal, give each the average of the ranks they would have taken. Two values tying for 3rd and 4th place both get 3.5; three values tying for 5th, 6th and 7th all get 6. Strictly, the \(6\sum d^2\) shortcut is then only approximate, and the exact method is to calculate Pearson’s r on the ranks. With a few ties the difference is tiny, and most exam questions accept the shortcut. Software always uses the exact method.
Spearman vs Pearson
| Pearson’s r | Spearman’s \(r_s\) | |
|---|---|---|
| Measures | Linear relationship | Monotonic relationship |
| Data | Numerical, roughly normal | Ordinal or numerical |
| Outliers | Very sensitive | Resistant |
| Curved but rising | Understates the link | Can still give +1 |
Free help or the books
For Pearson’s r, see how to calculate the correlation coefficient by hand; for choosing between tests, our which statistical test should I use flowchart. The Statistics Made Simple textbook works through correlation, regression and every hypothesis test by hand, with critical value tables built in.
Practice questions
EasyQ1. Five wines are ranked by two judges. Judge A: 1, 2, 3, 4, 5. Judge B: 2, 1, 4, 3, 5. Calculate \(r_s\). Show worked answer
\(r_s = 1 – \dfrac{6 \times 4}{5 \times 24} = 1 – 0.2 = 0.8\).
EasyQ2. Give the ranks for the data 7, 9, 9, 12, 15. Show worked answer
MediumQ3. For 10 pairs, \(\sum d^2 = 24\). Calculate \(r_s\) and test for association (two-tailed) at the 5% level. Show worked answer
Critical value (n = 10, two-tailed 5%) = 0.648. \(0.855 > 0.648\), so reject \(H_0\): there is evidence of association.
MediumQ4. Explain why Spearman’s coefficient might be preferred to Pearson’s for data on country GDP per capita and life expectancy. Show worked answer
ExamQ5. A geography student measures distance from the city centre (km) and house price for 8 properties and finds \(r_s = -0.71\). (a) State suitable hypotheses for a test of negative association. (b) Carry out the test at 5%. (c) Comment on whether the result proves distance causes lower prices. [6 marks] Show worked answer
(b) One-tailed 5% critical value for n = 8 is 0.643 (−0.643). [1] \(-0.71 < -0.643\), so reject \(H_0\). [1] There is evidence that prices tend to fall with distance from the centre. [1]
(c) No: correlation does not prove causation; house size, age or local schools may differ with distance, and the sample of 8 is small. [2]
Frequently asked questions
Can Spearman’s rank be used for small samples?
Yes, it is designed for them. Very small samples (under about 5) have little power, though, so even strong relationships may not be significant.
What does rs = 1 mean?
The ranks match exactly: the variables have a perfect increasing monotonic relationship. It does not require a straight line.
Do I need normal data?
No. That is one of the main reasons to use Spearman instead of Pearson.
References
- Spearman, C. (1904) ‘The proof and measurement of association between two things’, American Journal of Psychology, 15(1), pp. 72–101. https://doi.org/10.2307/1412159
- Zar, J. H. (1972) ‘Significance testing of the Spearman rank correlation coefficient’, Journal of the American Statistical Association, 67(339), pp. 578–580. https://doi.org/10.1080/01621459.1972.10481251
- Field, A. (2024) Discovering Statistics Using IBM SPSS Statistics. 6th edn. London: SAGE.

