Spearman’s Rank Correlation Coefficient – Formula, Derivation & Examples

Last Updated on Jun 12, 2025
Download As PDF
IMPORTANT LINKS

Spearman’s Rank Correlation Coefficient establishes a source between the predicted and observed values. Spearman’s Rank Correlation Coefficient formula determines the relationship between two variables, and the resulting relationship explains the precision of the expected and actual values.

In mathematics, correlation is a statistical technique used to determine the relationship/association between 2 variables. The correlation coefficient is used to quantify correlation numerically.

Maths Notes Free PDFs
Topic PDF Link
General and Middle Term in Binomial Free Notes PDF Download PDF
Circle Study Notes Download PDF
Tangents and Normal to Conics Download PDF
Increasing and Decreasing Function in Maths Download PDF
Wheatstone Bridge Notes Download PDF
Alternating Current Notes Download PDF
Friction in Physics Download PDF
Drift Velocity Notes Download PDF
Chemical Equilibrium Notes Download PDF
Quantum Number in Chemistry Notes Download PDF

Correlation coefficient formula assists in calculating the correlation coefficient, which quantifies one variable’s dependence on another. Correlation coefficients can change their value from -1 to 1.


What is Spearman’s Rank Correlation Coefficient?

Spearman’s Rank Correlation Coefficient can be defined as a non-parametric measure of rank correlation (statistical dependence of ranking between 2 variables).

Negative correlation coefficients indicate an inverse relationship between two variables. A positive correlation coefficient indicates that one variable’s value is directly related to the value of another variable. A zero correlation coefficient indicates no correlation between the two variables.

There are numerous types of correlation coefficients, the most common of which is the Pearson Correlation Coefficient (PCC). Furthermore, it is critical to understand the monotonic function to comprehend Spearman’s Rank Correlation.

What is a monotonic function?

A monotonic function is a function between ordered sets that preserves or reverses the given order.

You can learn the Regression Coefficient and Drag Coefficient.

Spearman’s Rank Correlation Coefficient Formula

Spearman’s rank correlation coefficient formula quantifies the degree and direction of association between two ranked variables. It measures the monotonicity of a relationship between two variables, that is, how well a monotonic function can represent the relationship between two variables.

Spearman’s rank coefficient formula can be calculated using the following formula:

In the above-given formula,

= Distinction between each observation’s two ranks

n = Numerical value for the number of observations.

𝝆 = Spearman’s Rank Coefficient

The Spearman Rank Correlation Coefficient can be anywhere between -1 and +1, in which,

  • A rank associated with a value of +1 is perfect.
  • A value of zero indicates that no correlation exists between ranks.
  • A rank associated with a value of -1 is excellent.

Test Series
130.8k Students
NCERT XI-XII Physics Foundation Pack Mock Test
323 TOTAL TESTS | 5 Free Tests
  • 3 Live Test
  • 163 Class XI Chapter Tests
  • 157 Class XII Chapter Tests

Get Started

How to calculate spearman’s rank correlation coefficient?

We can calculate spearman’s rank correlation coefficient using the following steps:

Step 1: Find the two variables’ covariance.

Step 2: Find each variable’s standard deviation.

Step 3: Multiply the covariance by the variances of two variables.

Derivation of Spearman’s Rank Correlation Coefficient

Spearman’s Rank Correlation Coefficient formula has been derived from a simple correlation coefficient where individual values have been replaced by ranks. These ranks are used for the calculation of correlation. This coefficient provides a measure of linear association between ranks assigned to these units, not their values.

Spearman’s rank correlation coefficient formula is –

where ‘n’ is the number of observations and ‘D’ is the deviation of ranks assigned to a variable from those assigned to the other variable. All the properties of the simple correlation coefficient are applicable here.

Like the Pearsonian Coefficient of correlation, it lies between 1 and –1. Generally, it is not as accurate as the ordinary method. This is due to the fact that all the information concerning the data is not utilized.

The first difference is the difference in consecutive values. The first differences in the values of items in the series, arranged in order of magnitude, are almost never constant. The data cluster around the central values with smaller differences in the middle of the array. If the first differences were constant, then r and rk would give identical results. In general, rk is less than or equal to r.

You can attempt Spearman’s Rank Correlation Coefficient MCQs.

Properties of Spearman’s Rank Correlation Coefficient

The properties of spearman’s rank correlation coefficient are as follows:

Spearman Correlation Coefficients are frequently referred to as “non-parametric”. This could have two interpretations.

A perfect Spearman correlation exists when any monotonic function connects X and Y. The Pearson correlation provides an exact value only when a linear function relates X and Y.

The Spearman correlation is non-parametric because its precise sampling distribution can be obtained without knowing the joint probability distributions of X and Y (i.e., without knowing the parameters).

The values of spearman’s rank correlation coefficient will always vary between–1 and 1.

Learn about Karl Pearson’s Correlation Coefficient

Advantages of Spearman’s Rank Correlation
  • Easy to Understand: The method is simple and doesn’t require complex math.

  • Great for Qualitative Data: It works well for ranking things like intelligence, beauty, or performance — where exact values aren’t available.

  • Works with Rankings: You can use it when your data is in order (like 1st, 2nd, 3rd), even if you don’t know the actual values.

  • Not Affected by Outliers: Extreme values won’t distort the results since it uses ranks, not actual numbers.

  • Good for Monotonic Relationships: It captures relationships where, as one variable increases, the other either always increases or always decreases (but not necessarily at a constant rate).

Disadvantages of Spearman’s Rank Correlation
  • Not for Grouped Data: You can’t use it when the data is grouped into categories or intervals.

  • Limited Data Handling: It’s better suited for small to moderate datasets, not large ones.

  • Misses Complex Relationships: It only detects simple increasing or decreasing trends — not curves or other patterns.

  • Ignores Actual Differences: It only looks at the order, not how far apart the values really are.

  • Loss of Detail: Turning data into ranks can remove important information, especially if actual numbers and units matter.

Difference between Spearman and Pearson Correlation

Feature

Spearman Correlation

Pearson Correlation

Type of Data

Works with ranked (ordinal), interval, or ratio data

Works with continuous numerical data

Data Distribution

Non-parametric – does not assume any specific distribution

Assumes data follows a normal (bell-shaped) distribution

Type of Relationship Measured

Detects monotonic relationships (data that moves in one direction, not necessarily linear)

Detects linear relationships (data changes at a constant rate)

Use Case

Best when data is in ranks or when relationship may not be straight-line

Best when you want to measure how strongly two numeric variables move together linearly

Sensitivity to Outliers

Less affected by extreme values (outliers)

More affected by extreme values (outliers)

Spearman’s Rank Correlation Coefficient Solved Examples

For a better understanding of Spearman’s Rank Correlation Coefficient solved examples have been demonstrated below:

Example 1: The scores for 9 students in maths and physics are as follows:
Physics: 35, 23, 47, 17, 10, 43, 9, 6, 28
Mathematics: 30, 33, 45, 23, 8, 49, 12, 4, 31
Compute the student’s ranks in the two subjects and compute the Spearman rank correlation.

Solution:

Step 1: Find the ranks for each individual subject. Assign the rank 1 to the highest score, 2 to the next highest and so on:

Physics

Rank

Maths

Rank

35

3

30

5

23

5

33

3

47

1

45

2

17

6

23

6

10

7

8

8

43

2

49

1

9

8

12

7

6

9

4

9

28

4

31

4

Step 2: Add the third column ‘d’ to your data. The d is the difference between ranks. For example, the first student’s physics rank is 3 and maths rank is 5, so the difference is 2 points. In a fourth column, square your d values.

Step 3: Add all the d-squared values:

4 + 4 + 1 + 0 + 1 + 1 + 1 + 0 + 0 = 12. You’ll need this for the formula (the is just the sum of d-squared values).

Step 4: Insert the values into the formula. These ranks are not tied, so use the first formula:

Compute the student’s ranks in the two subjects and compute Spearman’s rank correlation.
= 1 – (6*12)/(9(81-1))
= 1 – 72/720
= 1-0.1
= 0.9

The Spearman’s Rank Correlation for this set of data is 0.9.

Example 2: Spearman’s Rank Correlation Between Judges

Problem:
Five persons are being judged by three judges (A, B, and C) in a beauty contest. Their rankings are given below. Find which pair of judges has the most similar perception of beauty using Spearman’s Rank Correlation.

Rankings Given:

Competitor

Judge A

Judge B

Judge C

1

1

2

1

2

2

4

3

3

3

1

5

4

4

5

2

5

5

3

4

Step 1: Spearman’s Rank Correlation Formula

ρ=1−6∑d2/n(n2−1)

Where:

  • ddd = difference between ranks
  • nnn = number of competitors = 5

1. Rank Correlation Between Judges A and B

Competitor

A

B

d = A − B

1

1

2

-1

1

2

2

4

-2

4

3

3

1

2

4

4

4

5

-1

1

5

5

3

2

4

Total

-

-

-

14

ρ_AB = 1 - (6 × 14) / [5 × (25 - 1)] 

= 1 - (84 / 120) 

= 1 - 0.7 

= 0.3

2. Rank Correlation Between Judges A and C

Competitor

A

C

d = A − C

1

1

1

0

0

2

2

3

-1

1

3

3

5

-2

4

4

4

2

2

4

5

5

4

1

1

Total

-

-

-

10

ρ_AC = 1 - (6 × 10) / [5 × (25 - 1)] 

= 1 - (60 / 120) 

= 1 - 0.5 

= 0.5

3. Rank Correlation Between Judges B and C

Competitor

B

C

d = B − C

1

2

1

1

1

2

4

3

1

1

3

1

5

-4

16

4

5

2

3

9

5

3

4

-1

1

Total

-

-

-

28

ρ_BC = 1 - (6 × 28) / [5 × (25 - 1)]

= 1 - (168 / 120)

= 1 - 1.4

= -0.4

After substituting these values in Spearman’s rank correlation formula, the rank correlation comes to 0.5. Similarly, the rank correlation between the rankings of judges B and C is -0.4. Hence, the perceptions of judges A and C are the closest. Judges B and C have very different tastes.

If you are checking Spearman's rank correlation coefficient article, also check the related maths articles:

Regression Coefficient

Drag Coefficient

Coefficient of Linear Expansion

Ratio and Proportion

Linear Equations

Karl Pearson’s Correlation Coefficient

We hope this study material helped you understand the concept of Spearman’s Rank Coefficient. We offer a wide range of tutorials, practice tests, and other resources to our students, so they can pick and choose what they want to learn. Now is the time to get the Testbook App!. For better practice, solve the below provided previous year papers and mock tests for each of the given entrance exam:

Important Links
NEET Exam
NEET Previous Year Question Papers NEET Mock Test NEET Syllabus
CUET Exam
CUET Previous Year Question Papers CUET Mock Test CUET Syllabus
JEE Main Exam
JEE Main Previous Year Question Papers JEE Main Mock Test JEE Main Syllabus
JEE Advanced Exam
JEE Advanced Previous Year Question Papers JEE Advanced Mock Test JEE Advanced Syllabus
More Articles for Maths

FAQs For Spearmans Rank Correlation Coefficient

n in the correlation coefficient formula refers to the sample size.

The Correlation Coefficient Formula determines the relationship between two variables by comparing predicted and actual values.

The Pearson product-moment correlation can be calculated using coefficient correlation.Step 1: Find the two variables' covariance.Step 2: Find each variable's standard deviation.Step 3: Multiply the covariance by the variances of two variables.

The coefficient correlation formula is used in the following applications:The coefficient correlation formula aids in data analysis by quantifying the degree of two variables' linear relationship.It is used in financial analysis to determine the relationship between data sets and thus help make decisions.It aids in decision-making in many fields by revealing the strength of the relationship between two variables.

The Spearman rank-order correlation coefficient (Spearman's Correlation) measures the strength and direction of the association between two variables measured on an ordinal scale.

+1: Perfect positive correlation 0: No correlation –1: Perfect negative correlation

It is used when the data is ordinal (can be ranked) or when we don’t want to assume a linear relationship between variables. It's especially helpful when the relationship is monotonic (consistently increasing or decreasing).

Report An Error