Spearman rank correlation: the non-parametric test
Rank each variable (ties share the average rank), find each pair's rank difference d and compute rₛ = 1 − 6Σd² ÷ [n(n² − 1)]. It measures monotonic, not just linear, association and needs no normality. For n ≤ 30 use a Spearman table; above 30, a t-test with n − 2 degrees of freedom (df).
Watch the lesson 14 min
The video follows this page: the same examples, then the checkpoint questions.
Before this: Is a correlation significant? The t-test of correlation
On the exam
- Compare and contrast parametric and non-parametric tests, describe situations in which each is the more appropriate type of test, construct appropriate hypothesis tests, and interpret the results
Explain the Spearman rank correlation test and determine whether to reject H₀: ρ = 0. Expect to compute rₛ from a sum of squared rank differences, and to pick Spearman over the parametric test when data are ranks, skewed or full of outliers.
How deeply to learn each part
- Know the idea
- Understand it in general. It frames other topics, but you will not calculate with it.
- Use it
- Understand it well enough to solve a question with it. Recognize when it applies.
- Memorize
- Learn it by heart. The exam will not give it to you.
You know this one. The full lesson is folded away. The takeaways, formulas and checkpoint below are your quick refresher, and the checkpoint is a fair test of whether you still do.
You tested strong here. The full lesson is folded away. The takeaways, formulas and checkpoint below are your quick refresher, and the checkpoint is a fair test of whether you still know it.
What is the Spearman rank correlation?
It is the correlation of the rank positions of two variables rather than of their values. If the highest value of X always goes with the highest value of Y, the ranks agree perfectly and the coefficient is +1. If they are exactly reversed it is −1.
The Spearman rank correlation coefficient is the non-parametric test of correlation (a non-parametric test assumes no distribution). It makes no assumption that the data are normally distributed.
How do you compute it?
Rank both variables the same way, take the difference between each pair of ranks, square the differences and sum them.
Rearranged, the formula gives the sum of squared differences from a known .
For 10 paired rankings, the sum of squared rank differences is 16. The Spearman rank correlation is closest to:
1 − 6 × 16 ÷ (10 × 99) = 0.903
Spearman correlation, rₛ0.903
- 1−(6×16÷(10×(10x²−1)))=
x² square
- 6ENTER16×10ENTERENTER×1−×÷CHS1+
ENTER enter (on the HP, puts the number on the stack) · CHS change sign
Try this 0 of 3
- Add the outlier and compare Pearson's r with r_s
- Rank the agency cost the other way (highest first)
- Edit values until r_s = 1 and check Pearson's r
Ranking direction for the agency cost
| Fund | X | Y | Rank X | Rank Y | d | d² |
|---|---|---|---|---|---|---|
| A | 1 | 2 | −1 | 1 | ||
| B | 2 | 1 | +1 | 1 | ||
| C | 3 | 4 | −1 | 1 | ||
| D | 4 | 3 | +1 | 1 | ||
| E | 5 | 6 | −1 | 1 | ||
| F | 6 | 5 | +1 | 1 | ||
| G | 7 | 8 | −1 | 1 | ||
| H | 8 | 10 | −2 | 4 | ||
| I | 9 | 7 | +2 | 4 | ||
| J | 10 | 9 | +1 | 1 | ||
| Σd² | 16 | |||||
Values: Pearson r 0.881
Ranks: r_s 0.903
Σd² = 16, so r_s = 1 − 6 × 16 ÷ 990 = 0.903. The two cost measures put the funds in almost the same order.
Show working
1. Rank X (lowest expense ratio = 1): 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
2. Rank Y the same way (lowest = 1): 2, 1, 4, 3, 6, 5, 8, 10, 7, 9.
3. d = rank X − rank Y: −1, +1, −1, +1, −1, +1, −1, −2, +2, +1. Σd² = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 4 + 4 + 1 = 16.
4. r_s = 1 − 6Σd² ÷ [n(n² − 1)] = 1 − 6 × 16 ÷ [10 × (10² − 1)] = 1 − 96 ÷ 990 = 0.9030.
Test of H₀: ρ = 0. With n = 10 (small), compare r_s with a Spearman critical value from a table; the question gives it. For n above 30 use t = r_s√(n − 2) ÷ √(1 − r_s²); here, for illustration, t = 5.95 against 2.306 (df 8, 5% two-tailed).
Pearson's r on the raw values is 0.881: it uses the size of every gap, so one extreme value can move it a lot.
- 1−(6×16÷(10×(10x²−1)))=r_s = 0.9030
- 0.90303×8√x÷(1−0.90303x²)√x=t = 5.95
x² square · √x square root
- 6ENTER16×10ENTER10ENTER×1−×÷CHS1+r_s = 0.9030
- 0.90303ENTER8g√x×1ENTER0.90303ENTER×−g√x÷t = 5.95
ENTER enter (on the HP, puts the number on the stack) · CHS change sign · g blue shift key · √x square root
Common slips: dropping the 6 or the “1 −”, and using n² instead of n² − 1.
What does Spearman measure that Pearson misses?
Pearson’s measures linear association. Spearman’s measures a monotonic relationship : one variable consistently rising (or consistently falling) as the other rises, along a straight line or a curve, with no reversals. A perfectly curved but always rising relationship has while Pearson’s is below 1.
Ties need care. Give tied values the average of the ranks they would occupy (average ranking ), so two values tied for third and fourth both get 3.5. Heavy ties make the simple formula slightly inexact, but the exam avoids them.
How do you test whether rₛ is significant?
It depends on the sample size. With n of 30 or fewer, a special table of Spearman critical values is needed, which the question will supply. With a large sample (n above 30), use the same t-statistic as the parametric test, with degrees of freedom.
The ten-fund example has , so in practice you would use the Spearman table the question supplies. The exam would not ask for a t-test there. Purely for practice, the same formula with the unrounded gives , far beyond 2.306 at 8 degrees of freedom, but the table is the method to use at that size.
When should you choose Spearman?
Choose it when the parametric test’s assumptions are doubtful: the data are ranks or ordinal grades, one extreme observation would dominate Pearson’s , or the variables are clearly non-normal.
- Parametric t-test Memorize Pearson r on the actual values
- Both variables roughly normal no extreme outliers
- More powerful when its assumptions hold
-
- Spearman rank test Memorize rₛ on the ranks
- Data are ranks or ordinal fund rankings, credit grades
- Outliers or non-normal data ranks tame them
- Critical value n ≤ 30: Spearman table; n > 30: t-test, df n − 2
-
The cost is power. When both variables really are close to normal, the parametric test is more likely to detect a true correlation.
Exam tip If a question mentions rankings, grades or “an extreme month”, the answer is Spearman. If it says “approximately normal” and gives return data, it is the parametric test.
Memorize this
MemorizeSpearman in four steps
| Step | Action |
|---|---|
| 1 | Rank (best to worst, or the reverse) |
| 2 | Rank the same way; ties share the average rank |
| 3 | = rank − rank ; square and sum |
| 4 |
Memory hook "1 minus 6 d-squared over n times n-squared-minus-one." If every rank matches, Σd² = 0 and rₛ = 1.
Know it cold n ≤ 30: the Spearman table the question gives. n > 30: , df .
- Parametric t-test Memorize Pearson r on the actual values
- Both variables roughly normal no extreme outliers
- More powerful when its assumptions hold
-
- Spearman rank test Memorize rₛ on the ranks
- Data are ranks or ordinal fund rankings, credit grades
- Outliers or non-normal data ranks tame them
- Critical value n ≤ 30: Spearman table; n > 30: t-test, df n − 2
-
Quick example
8 pairs of rankings with Σd² = 14. rₛ = 1 − 6 × 14 ÷ (8 × 63) = 1 − 84 ÷ 504 = 0.833.
- 1−(6×14÷(8×(8x²−1)))= 0.8333
x² square
- 6ENTER14×8ENTERENTER×1−×÷CHS1+ 0.8333
ENTER enter (on the HP, puts the number on the stack) · CHS change sign
Quick example
rₛ = 0.38 from 50 pairs. t = 0.38 × √48 ÷ √(1 − 0.1444) = 2.85, against a critical value of 2.011.
- 0.38×48√x÷(1−0.38x²)√x= 2.8462
√x square root · x² square
- 0.38ENTER48g√x×1ENTER0.38ENTER×−g√x÷ 2.8462
ENTER enter (on the HP, puts the number on the stack) · g blue shift key · √x square root
How it is asked
-
Compute rₛ from Σd²
15 paired rankings, Σd² = 90. Spearman correlation?
1 − 6 × 90 ÷ (15 × 224) = 0.84. Omitting the 6 gives 0.97, omitting the "1 −" gives 0.16.
-
Which test fits the data?
20 funds ranked by two rating agencies.
Ranked data: Spearman. Roughly normal returns with no outliers favor the parametric test.
-
Large-sample test
rₛ = 0.38, n = 50, critical value 2.011.
n > 30, so t = 0.38 × √48 ÷ √(1 − 0.1444) = 2.85: reject H₀.
-
Small sample
rₛ from 22 pairs. How to test?
Spearman table (n ≤ 30). The t-test is the trap.
Exam traps
- Forgetting the 6 or the 1 − in the formula.
- Using n² instead of n² − 1 in the denominator.
- Ranking the two variables in opposite directions.
- Using the Spearman formula on raw values instead of ranks.
- Reaching for the t-test when n is 30 or fewer. The question gives a Spearman table for that.
Checkpoint
5 exam-style questions. About 90 seconds each.
1For 12 paired rankings, the sum of squared rank differences is 40. The Spearman rank correlation is closest to:
2Which situation most favors the Spearman test over the parametric test of correlation?
3Compared with the parametric test of correlation, the Spearman test is least likely to be affected by:
4A researcher computes a Spearman rank correlation of 0.45 from 40 pairs of observations. The critical value at the 5% level is 2.024. The t-statistic and the conclusion are closest to:
5An analyst computes a Spearman rank correlation from 18 pairs of observations. To test whether it is significant, the analyst should most appropriately use:
Key takeaways
- rₛ = 1 − 6Σd² ÷ [n(n² − 1)], computed on ranks.
- Use Spearman for ranks, outliers and non-normal data.
- n ≤ 30: a Spearman table. n > 30: the t formula with n − 2 degrees of freedom.
Quick example
8 pairs of rankings with Σd² = 14. rₛ = 1 − 6 × 14 ÷ (8 × 63) = 1 − 84 ÷ 504 = 0.833.
- 1−(6×14÷(8×(8x²−1)))= 0.8333
x² square
- 6ENTER14×8ENTERENTER×1−×÷CHS1+ 0.8333
ENTER enter (on the HP, puts the number on the stack) · CHS change sign
Quick example
rₛ = 0.38 from 50 pairs. t = 0.38 × √48 ÷ √(1 − 0.1444) = 2.85, against a critical value of 2.011.
- 0.38×48√x÷(1−0.38x²)√x= 2.8462
√x square root · x² square
- 0.38ENTER48g√x×1ENTER0.38ENTER×−g√x÷ 2.8462
ENTER enter (on the HP, puts the number on the stack) · g blue shift key · √x square root
All Quantitative Methods formulas, every lesson
Practice exam-style questions on Estimation and Hypothesis Testing
Questions about this lesson?
Where this comes back
- Chi-square test of independence with a contingency table Estimation and Hypothesis Testing
- Simple Linear Regression in Finance Quantitative Methods
Questions candidates ask
What is the Spearman rank correlation coefficient?
It is the correlation of the ranks of two variables instead of their raw values. It equals 1 − 6Σd² ÷ [n(n² − 1)], where d is the difference between each observation's two ranks. It ranges from −1 to +1 like Pearson's r.
When should you use Spearman instead of Pearson correlation?
Use Spearman when the data are ranks, when outliers would dominate Pearson's r, or when the variables are clearly non-normal. It also picks up consistent relationships that are not straight lines. The price is lower power when the parametric assumptions do hold.
How do you test Spearman's rank correlation for significance?
With n of 30 or fewer, compare rₛ with a Spearman critical value from a table the question supplies. When n is above 30, use t = rₛ√(n − 2) ÷ √(1 − rₛ²) with n − 2 degrees of freedom, exactly as in the parametric test.
Spotted an error? Tell us and we will fix it.