Analyst Dojo
Lesson 12 of 13 11–14% of the exam

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).

6 min cram, 26 min full read. Based on the 2027 CFA® Program Level I curriculum, Quantitative Methods, Learning Module 7. Sitting in November 2026? The 2026 version of this lesson is still available.

Tailor this to you: take the self-assessment

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.

Cram mode: the one-screen version of this lesson. Switch to Full for the explanations, worked examples and interactives.

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.

Spearman rank correlation Memorize
rs=1−6∑di2n (n2−1)r_s = 1 - \frac{6\sum d_i^2}{n\,(n^2 - 1)}

Rearranged, the formula gives the sum of squared differences from a known rsr_s.

Rearrange itSpearman rank correlation: solve for any one
The question asks for
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

On your calculator
  1. 1−(6×16÷(10×(10x²−1)))=

x² square

  1. 6ENTER16×10ENTERENTER×1−×÷CHS1+

ENTER enter (on the HP, puts the number on the stack) · CHS change sign

InteractiveSpearman's rank correlation: rank, subtract, square

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

Annual cost (%): X = expense ratio; Y = rating agency's all-in cost estimate (lowest = best rated)
FundXYRank XRank Ydd²
A12−11
B21+11
C34−11
D43+11
E56−11
F65+11
G78−11
H810−24
I97+24
J109+11
Σd²16

Values: Pearson r 0.881

Expense ratioAgency cost

Ranks: r_s 0.903

Rank XRank Y
Σd²16
Spearman r_s0.903
Pearson r (raw values)0.881
t for r_s (df 8)5.95

Σ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.

r_s (and its t) on your calculator
  1. 1−(6×16÷(10×(10x²−1)))=r_s = 0.9030
  2. 0.90303×8√x÷(1−0.90303x²)√x=t = 5.95

x² square · √x square root

  1. 6ENTER16×10ENTER10ENTER×1−×÷CHS1+r_s = 0.9030
  2. 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.

Ranks tame outliers: Spearman barely notices one wild point.

What does Spearman measure that Pearson misses?

Pearson’s rr measures linear association. Spearman’s rsr_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 rs=1r_s = 1 while Pearson’s rr 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 n−2n-2 degrees of freedom.

t-statistic for large samples (n > 30) Memorize
t=rsn−21−rs2,df=n−2t = \frac{r_s\sqrt{n-2}}{\sqrt{1-r_s^2}}, \qquad df = n - 2

The ten-fund example has n=10n = 10, 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 rs=0.90303r_s = 0.90303 gives t=0.90303×8÷1−0.903032=5.95t = 0.90303 \times \sqrt{8} \div \sqrt{1 - 0.90303^2} = 5.95, 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 rr, or the variables are clearly non-normal.

Which test of a correlation?
Test H₀: ρ = 0choose by the data
  • 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

StepAction
1Rank XX (best to worst, or the reverse)
2Rank YY the same way; ties share the average rank
3dd = rank XX − rank YY; square and sum
4rs=1−6∑d2/[n(n2−1)]r_s = 1 - 6\sum d^2 / [n(n^2-1)]

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: t=rsn−2/1−rs2t = r_s\sqrt{n-2}/\sqrt{1-r_s^2}, df n−2n-2.

Which test of a correlation?
Test H₀: ρ = 0choose by the data
  • 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
Spearman rank correlation Memorize
rs=1−6∑di2n (n2−1)r_s = 1 - \dfrac{6\sum d_i^2}{n\,(n^2 - 1)}
Quick example

8 pairs of rankings with Σd² = 14. rₛ = 1 − 6 × 14 ÷ (8 × 63) = 1 − 84 ÷ 504 = 0.833.

On your calculator
  1. 1−(6×14÷(8×(8x²−1)))= 0.8333

x² square

  1. 6ENTER14×8ENTERENTER×1−×÷CHS1+ 0.8333

ENTER enter (on the HP, puts the number on the stack) · CHS change sign

t-statistic for large samples (n > 30) Memorize
t=rsn−21−rs2,df=n−2t = \dfrac{r_s\sqrt{n-2}}{\sqrt{1-r_s^2}},\quad df = n - 2
Quick example

rₛ = 0.38 from 50 pairs. t = 0.38 × √48 ÷ √(1 − 0.1444) = 2.85, against a critical value of 2.011.

On your calculator
  1. 0.38×48√x÷(1−0.38x²)√x= 2.8462

√x square root · x² square

  1. 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

  1. 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.

  2. 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.

  3. 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₀.

  4. 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.

  1. 1For 12 paired rankings, the sum of squared rank differences is 40. The Spearman rank correlation is closest to:

  2. 2Which situation most favors the Spearman test over the parametric test of correlation?

  3. 3Compared with the parametric test of correlation, the Spearman test is least likely to be affected by:

  4. 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:

  5. 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.
Spearman rank correlation Memorize
rs=1−6∑di2n (n2−1)r_s = 1 - \dfrac{6\sum d_i^2}{n\,(n^2 - 1)}
Quick example

8 pairs of rankings with Σd² = 14. rₛ = 1 − 6 × 14 ÷ (8 × 63) = 1 − 84 ÷ 504 = 0.833.

On your calculator
  1. 1−(6×14÷(8×(8x²−1)))= 0.8333

x² square

  1. 6ENTER14×8ENTERENTER×1−×÷CHS1+ 0.8333

ENTER enter (on the HP, puts the number on the stack) · CHS change sign

t-statistic for large samples (n > 30) Memorize
t=rsn−21−rs2,df=n−2t = \dfrac{r_s\sqrt{n-2}}{\sqrt{1-r_s^2}},\quad df = n - 2
Quick example

rₛ = 0.38 from 50 pairs. t = 0.38 × √48 ÷ √(1 − 0.1444) = 2.85, against a critical value of 2.011.

On your calculator
  1. 0.38×48√x÷(1−0.38x²)√x= 2.8462

√x square root · x² square

  1. 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

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.

  1. The central limit theorem and the standard error of the mean
  2. Confidence intervals for a mean return
  3. Value at risk from the normal distribution
  4. Sampling methods and sampling error
  5. How a hypothesis test works: four steps from claim to decision
  6. Type I and Type II errors and the power of a test
  7. t-tests of a mean, a difference in means and paired differences
  8. Chi-square and F-tests of variance
  9. Is a correlation significant? The t-test of correlation
  10. P-values, p-hacking and critical values from software
  11. Parametric vs non-parametric tests
  12. Spearman rank correlation: the non-parametric test
  13. Chi-square test of independence with a contingency table

Ask Sensei Listen instead

Questions on Spearman rank correlation: the non-parametric test

Learn with Sensei, out loud The voice tutor, in early access

Sensei teaches the lesson aloud and stops when you interrupt: "wait, why is the geometric mean lower?" It answers with the lesson's own example, then quizzes you by voice. Every account can try Sensei on one module, with one voice question.

USD 149 a month founding price (regular USD 199), kept for as long as you stay subscribed. Everything in Plus included.

In active development and improving every day. Send feedback · Plans and pricing

Analyst Dojo Plus

Your free review list holds 10 items.

Plus keeps everything you save, for USD 19 a month. To make room on the free plan, remove something from your review list.

See Plus

Lessons, checkpoints and the lesson questions in practice stay free. Compare plans