Skip to content

Quantitative Aptitude · Correlation and Regression

Spearman's Rank Correlation for CA Foundation

Updated 1 October 2026 · Fact-checked

Spearman's rank correlation measures how closely two sets of ranks move together, from −1 to +1. Rank both series, find each difference D, square it, then use r = 1 − 6ΣD² ÷ n(n² − 1). If ranks repeat, give tied items the average rank and add m(m² − 1) ÷ 12 for each tied group to ΣD².

Understand Spearman's Rank Correlation

Karl Pearson's coefficient needs measured values like marks or sales. Sometimes you only have ranks, or the data is qualitative, such as beauty, honesty or taste. Two judges can rank ten contestants, but they cannot give exact scores. Spearman's rank correlation handles this case.

The idea is simple. If two people rank items in the same order, the rank differences are all zero and the correlation is +1. If one ranking is the exact reverse of the other, the differences are large and the correlation is −1. The formula turns the squared rank differences into a number between −1 and +1.

You can also use it when you have raw numbers. Convert each series into ranks first, then apply the formula. Rank both series in the same direction, either highest = 1 or lowest = 1. The direction does not matter as long as you are consistent.

Sometimes two items have the same value, so they tie. Give each tied item the average of the ranks they would have occupied. For example, two items tied for 3rd and 4th place each get 3.5. The next item then gets rank 5. A tied group raises the formula's accuracy problem, so you add a correction factor to ΣD².

The result reads like Pearson's r. Near +1 means strong agreement, near −1 means strong opposite ordering, and near 0 means little relation in the ranks. Spearman's measure is about the ranks, not the actual values.

Key formulas to remember

Spearman's rank correlation (no ties)
r = 1 − 6ΣD² ÷ [n(n² − 1)]
D = difference between the two ranks of the same item. n = number of items (pairs).
With tied ranks
r = 1 − 6[ΣD² + Σ m(m² − 1) ÷ 12] ÷ [n(n² − 1)]
m = number of items in each tied group. Add one term for every tied group in either series.
Correction for one tie of 2
m(m² − 1) ÷ 12 = 2 × 3 ÷ 12 = 0.5
A tie of 3 gives 3 × 8 ÷ 12 = 2.
Average rank for a tie
Average rank = (sum of the ranks the tied items would take) ÷ m
The next untied item continues after the full group, so ranks 3 and 4 tied means the next item is rank 5.
Check on rank differences
ΣD = 0
The differences must add up to zero. If not, you made an error in ranking or subtracting.
Range of the value
−1 ≤ r ≤ +1
+1 means identical ranking and −1 means exactly reversed ranking.

How to solve Spearman's Rank Correlation questions

Use this order for any Spearman question, whether ranks are given or you must build them from raw values.

  1. 1Check what is given. If ranks are given, use them. If raw values are given, you must convert them to ranks.
  2. 2Rank each series separately in the same direction (highest = 1 is usual). For equal values, give each the average rank.
  3. 3Find D = R₁ − R₂ for every item and confirm that ΣD = 0.
  4. 4Square each D and add to get ΣD².
  5. 5If any ties exist, compute m(m² − 1) ÷ 12 for each tied group and add all of them to ΣD².
  6. 6Put n, and the corrected ΣD², into r = 1 − 6ΣD² ÷ [n(n² − 1)].
  7. 7Compute carefully and check that the answer lies between −1 and +1, then match it with the options.

Quickest way: Fast route for Spearman MCQs

When to use it: Use when the question is objective and time is short, especially with 5 to 10 items.

  1. Compute n(n² − 1) first. Useful values: n = 5 gives 120, n = 6 gives 210, n = 7 gives 336, n = 8 gives 504, n = 10 gives 990.
  2. Rank rough values quickly by writing the rank under each number. Mark ties at once with the average rank.
  3. Add ΣD² and the tie correction in one go, then compute 6ΣD² ÷ n(n² − 1) as a simple fraction. For n = 5, 6ΣD² ÷ 120 is just ΣD² ÷ 20.
  4. Use quick elimination: if all ranks match then r = 1, and if all are reversed then r = −1. A small ΣD² means r is close to +1.
  5. If ΣD² is more than n(n² − 1) ÷ 6, then r is negative. Use this to remove options with the wrong sign.
  6. Skip a question with 10 or more items and many ties if the paper is long. Negative marking is 0.25 per wrong answer, so do not guess blindly.

Common mistakes in Spearman's Rank Correlation

  • Ranking one series highest = 1 and the other lowest = 1.

    Students rank each column on its own without thinking about direction.

    Fix: Pick one direction before you start and apply it to both series. Check ΣD = 0 afterwards.

  • Giving tied items the same lower rank, such as both 3, instead of 3.5.

    Students forget that ranks are shared, not repeated.

    Fix: Add up the ranks the tied items would take and divide by m. Two items at 3rd and 4th get 3.5 each, and the next item gets 5.

  • Forgetting the correction factor when ties exist.

    Students use the basic formula in a hurry.

    Fix: Scan both columns for repeated values before you calculate. Add m(m² − 1) ÷ 12 for every tied group.

  • Applying the correction only once when both series have ties.

    Students think one correction covers the whole problem.

    Fix: Add one term per tied group in X and one per tied group in Y.

  • Using the formula 1 − 6ΣD² ÷ n² − 1 or dividing by n(n² + 1).

    Memory slip between similar-looking expressions.

    Fix: Remember the denominator is n(n² − 1), the same as (n − 1) × n × (n + 1). Test with n = 5: the denominator is 120.

  • Skipping the sign of the answer, or reporting r > 1.

    Arithmetic errors go unchecked.

    Fix: Always check that −1 ≤ r ≤ +1. If ΣD² exceeds n(n² − 1) ÷ 3 then you have an error, since the maximum ΣD² is n(n² − 1) ÷ 3.

Worked examples

Example 1

Five students have marks in two tests. Test X: 60, 45, 70, 30, 50. Test Y: 5, 8, 9, 2, 6. The rank correlation coefficient is: (a) 0.8 (b) 0.6 (c) 0.4 (d) −0.6

Show the solution
  1. Rank X (highest = 1): 70 → 1, 60 → 2, 50 → 3, 45 → 4, 30 → 5. In the given order the X ranks are 2, 4, 1, 5, 3.
  2. Rank Y (highest = 1): 9 → 1, 8 → 2, 6 → 3, 5 → 4, 2 → 5. In the given order the Y ranks are 4, 2, 1, 5, 3.
  3. D = X rank − Y rank = −2, 2, 0, 0, 0. ΣD = 0, which checks out.
  4. D² = 4, 4, 0, 0, 0, so ΣD² = 8.
  5. There are no ties, so r = 1 − 6 × 8 ÷ [5 × 24] = 1 − 48 ÷ 120 = 1 − 0.4 = 0.6.

Answer: (b) 0.6

Example 2

Test X: 10, 20, 20, 30, 40 and Test Y: 12, 18, 25, 20, 30 are scores of five candidates. The rank correlation coefficient with the tie correction is: (a) 0.80 (b) 0.825 (c) 0.70 (d) 0.90

Show the solution
  1. Rank X (highest = 1): 40 → 1, 30 → 2, the two 20s share ranks 3 and 4 so each gets 3.5, and 10 → 5. In order the X ranks are 5, 3.5, 3.5, 2, 1.
  2. Rank Y (highest = 1): 30 → 1, 25 → 2, 20 → 3, 18 → 4, 12 → 5. In order the Y ranks are 5, 4, 2, 3, 1.
  3. D = 0, −0.5, 1.5, −1, 0. ΣD = 0, which checks out.
  4. D² = 0, 0.25, 2.25, 1, 0, so ΣD² = 3.5.
  5. One tied group with m = 2 in X, so correction = 2 × 3 ÷ 12 = 0.5. Corrected total = 3.5 + 0.5 = 4.
  6. r = 1 − 6 × 4 ÷ 120 = 1 − 0.2 = 0.8. Without the correction you would get 0.825, which is a trap.

Answer: (a) 0.80

Example 3

For 10 pairs of ranks the rank correlation coefficient is 0.6. What is ΣD²? (a) 66 (b) 99 (c) 33 (d) 60

Show the solution
  1. Here n = 10, so n(n² − 1) = 10 × 99 = 990.
  2. Use r = 1 − 6ΣD² ÷ 990 and set it equal to 0.6.
  3. So 6ΣD² ÷ 990 = 1 − 0.6 = 0.4.
  4. 6ΣD² = 0.4 × 990 = 396.
  5. ΣD² = 396 ÷ 6 = 66.

Answer: (a) 66

Exam tips

  • Look at the data first. If the values are already ranks or the data is qualitative, use Spearman. If you have measured values and the question asks for Karl Pearson, use that method instead.
  • Scan for repeated values before calculating. A question with repeated values almost always tests the tie correction, and one of the options usually shows the uncorrected answer.
  • Memorise n(n² − 1) for n = 5 to 10. It saves time and lowers the risk of arithmetic slips.
  • Use ΣD = 0 as a free check. It takes seconds and catches ranking errors before they cost marks.
  • Remember the sign logic: r = +1 for identical ranking and r = −1 for exact reversal. Some MCQs test only this, with no calculation.

Practice questions from Correlation and Regression

Spearman's Rank Correlation: frequently asked questions

What is the difference between Karl Pearson and Spearman rank correlation?

Karl Pearson's coefficient uses the actual values and measures linear relationship. Spearman's uses only the ranks, so it suits qualitative or ranked data and is less affected by extreme values. Both give a value between −1 and +1.

How do I calculate rank correlation with repeated ranks?

Give each tied item the average of the ranks they would occupy. Then add m(m² − 1) ÷ 12 to ΣD² for every tied group, in both series. Use the usual formula with this corrected ΣD².

What is the Spearman rank correlation formula for CA Foundation?

It is r = 1 − 6ΣD² ÷ [n(n² − 1)], where D is the rank difference for each item and n is the number of pairs. With ties, add the correction factor to ΣD² inside the bracket.

Does it matter whether I rank highest as 1 or lowest as 1?

No, as long as you use the same direction for both series. If you mix directions, the sign of r will come out wrong.