Analyst Dojo
Lesson 2 of 3 6–9% of the exam

You are reading the 2026 curriculum (exams up to November 2026). Sitting in February 2027 or later? Go to the 2027 Quantitative Methods guide.

Spearman rank correlation: the nonparametric test

Rank each variable, find the difference d in ranks for each observation, and compute rₛ = 1 − 6Σd² ÷ [n(n² − 1)]. Because it uses ranks, it is not thrown by outliers and needs no normality. Test it against a Spearman table for small samples, or with the usual t formula when n is above 30.

6 min cram, 26 min full read. Based on the 2026 CFA® Program Level I curriculum, Quantitative Methods, Learning Module 9. This is the 2026 version of the lesson. Sitting in February 2027 or later? Read the updated 2027 version.

Tailor this to you: take the self-assessment

Before this: Hypothesis Testing, Statistical Measures of Asset Returns

On the exam

  • Explain parametric and nonparametric tests of the hypothesis that the population correlation coefficient equals zero, and determine whether the hypothesis is rejected at a given level of significance

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 main nonparametric test of correlation. 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.

How do you test whether rₛ is significant?

It depends on the sample size. With a small sample, compare rsr_s with a critical value from a Spearman table, 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 a Spearman table. Applied 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.

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 small n: Spearman table; n above 30: t formula

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.

Go deeper Ties and monotonic relationships

When two observations of the same variable tie, give each the average of the ranks they would have occupied. Two values tied for third and fourth place both get 3.5. Heavy ties make the simple formula slightly inexact, but the exam avoids them. Spearman measures a monotonic relationship: one variable consistently rising as the other rises, even along a curve. A perfectly curved but always rising relationship has rs=1r_s = 1 while Pearson’s rr is below 1.

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 Small sample: use the Spearman table the question gives. n > 30: use the t formula with n−2n-2 df.

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 small n: Spearman table; n above 30: t formula
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.45 from 40 pairs. t = 0.45 × √38 ÷ √(1 − 0.2025) = 3.11, against a critical value of 2.024.

On your calculator
  1. 0.45×38√x÷(1−0.45x²)√x= 3.1063

√x square root · x² square

  1. 0.45ENTER38g√x×1ENTER0.45ENTER×−g√x÷ 3.1063

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²

    12 paired rankings, Σd² = 40. Spearman correlation?

    1 − 6 × 40 ÷ (12 × 143) = 0.86. Omitting the 6 gives 0.98, omitting the "1 −" gives 0.14.

  2. Which test fits the data?

    15 funds ranked by two consultants.

    Ranked data: Spearman. Roughly normal returns with no outliers favor the parametric test.

  3. Large-sample test

    rₛ = 0.45, n = 40, critical value 2.024.

    n > 30, so t = 0.45 × √38 ÷ √(1 − 0.2025) = 3.11: reject H₀.

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.

Checkpoint

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

Key takeaways

  • rₛ = 1 − 6Σd² ÷ [n(n² − 1)], computed on ranks.
  • Use Spearman for ranks, outliers and non-normal data.
  • Large n (above 30): test with the t formula. Small n: a Spearman table.
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.45 from 40 pairs. t = 0.45 × √38 ÷ √(1 − 0.2025) = 3.11, against a critical value of 2.024.

On your calculator
  1. 0.45×38√x÷(1−0.45x²)√x= 3.1063

√x square root · x² square

  1. 0.45ENTER38g√x×1ENTER0.45ENTER×−g√x÷ 3.1063

ENTER enter (on the HP, puts the number on the stack) · g blue shift key · √x square root

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?

For small samples, 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. Is a correlation significant? The t-test of correlation
  2. Spearman rank correlation: the nonparametric test
  3. Chi-square test of independence with a contingency table

Ask Sensei Listen instead

Questions on Spearman rank correlation: the nonparametric 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