Spearman’s Rank Correlation
Spearman’s rank correlation is a non-parametric measure of the strength and direction of association that exists between two ranked variables. Unlike Pearson’s correlation, Spearman correlation does not assume a linear relationship or normal distribution. It is ideal when data is ordinal or not normally distributed.
1.0What is Spearman’s Rank Correlation?
Spearman's rank correlation coefficient (denoted by ρ or rₛ) measures the monotonic relationship between two sets of data. It evaluates how well the relationship between two variables can be described by a monotonic function—where values move in the same or opposite direction without necessarily forming a straight line.
It is commonly used in cases involving ranked data, and where Pearson’s correlation may not be suitable.
2.0Formula for Spearman’s Rank Correlation
The formula for Spearman's rank correlation coefficient is:
rs=1−n(n2−1)6∑di2
Where:
- rs = Spearman coefficient
- di = difference between the ranks of corresponding values of X and Y
- n = number of observations
This formula is used when there are no tied ranks.
3.0Handling Tied Ranks
When data has tied ranks (i.e., two or more items have the same value), average ranks are assigned. Adjustments are made to account for these ties using a more advanced version of the Spearman correlation formula that involves correction factors.
Steps to Calculate Spearman’s Rank Coefficient
- Rank the data: Assign ranks to both variables.
- Compute differences (d) between the two ranks.
- Square the differences: Find d2d^2 for each pair.
- Apply the formula for Spearman's rank correlation coefficient.
- Interpret the result.
4.0Interpretation of Spearman Coefficient of Correlation
5.0Applications of Spearman’s Rank Correlation
- Psychology and social sciences (e.g., ranking test scores)
- Market research (e.g., preference rankings)
- Biology (e.g., ranking of traits)
- Any scenario with ordinal data
6.0Solved Example on Spearman’s Rank Correlation
Example 1: A teacher wants to find the relationship between students’ ranks in Math and Science.
Solution:
∑d2=(1−2)2+(2−1)2+(3−4)2+(4−3)2+(5−5)2 =1+1+1+1+0=4rs=1−5(52−1)6(4)=1−12024=1−0.2=0.8
Interpretation:
There is a strong positive Spearman rank correlation (rₛ = 0.8) between the Math and Science ranks.
Example 2: Find the Spearman’s rank correlation coefficient for the following data:
Solution:
∑d2=1+1+1+1+0=4rs=1−5(52−1)6×4=1−12024=0.80
Interpretation: Strong positive correlation.
Example 3: Calculate the Spearman coefficient for:
Solution:
∑d2=4+1+1+1+1=8rs=1−5(25−1)6×8=1−12048=0.60
Interpretation: Moderate positive correlation.
Example 4: Two teachers rank five students based on Class Participation and Homework.
Solution:
∑d2=4+4+0+0+0=8rs=1−5(25−1)6×8=1−12048=0.60
Interpretation: Moderate positive correlation.
Example 5: Calculate Spearman’s rank coefficient for ranks in Math and Science.
Solution:
∑d2=0⇒rs=1−5(25−1)6⋅0=1
Interpretation: Perfect positive correlation.
Example 6: Ranks of students in two subjects are opposite. Find Spearman correlation.
Solution:
∑d2=16+4+0+4+16=40rs=1−5(25−1)6⋅40=1−120240=−1
Interpretation: Perfect negative correlation.
Example 7: The following table shows the ranks of 6 students in Mathematics and Physics. Calculate Spearman's rank correlation coefficient.
Solutions:
Step 1: Compute differences and squares
Step 2: Apply Spearman’s rank correlation formula
rs=1−n(n2−1)6∑d2=1−6(36−1)6×6 =1−21036=1−0.1714=0.8286
Answer:
There is a strong positive Spearman correlation between the Math and Physics ranks (rₛ ≈ 0.83).
7.0Practice Questions on Spearman’s Rank Correlation
Question 1: Calculate the Spearman coefficient of correlation for the ranks given below:
Question 2: A teacher recorded the following ranks for five students in Chemistry and Biology. Find Spearman's rank coefficient.
Question 3: The following data is collected from a class. Are the rankings of Maths and English scores positively correlated?
Question 4: What is the Spearman rank correlation when the ranks of two variables are exactly opposite?
Question 5: Two variables X and Y have identical ranks for each item. What is the Spearman's rank correlation coefficient?