Spearman’s rank correlation is a statistical measure used to assess the strength and direction of association between two ranked variables. Unlike Pearson correlation, which measures the linear relationship between variables, Spearman correlation evaluates the monotonic relationship. Monotonic means that as one variable increases, the other variable either consistently increases or decreases, but not necessarily at a constant rate.
Spearman’s Rank Correlation can be obtained in three basic cases :
- When Values or Variables are given
- When only Ranks are given
- When Ranks are repeated
Here’s how Spearman’s rank correlation works:
- Rank the values of each variable separately from lowest to highest.
- Assign ranks to each value, with the smallest value receiving a rank of 1, the second smallest a rank of 2, and so on.
- If there are tied values, assign them the average of the ranks they would occupy if they were not tied.
- Calculate the differences between the ranks for each pair of corresponding values.
- Square these differences and sum them.
- Use the formula to calculate Spearman’s rank correlation coefficient, which is typically denoted by the symbol ρ (rho).
The Spearman correlation coefficient can range from -1 to 1:
- A value of 1 indicates a perfect positive monotonic relationship, meaning that as one variable increases, the other variable also increases.
- A value of -1 indicates a perfect negative monotonic relationship, meaning that as one variable increases, the other variable decreases.
- A value of 0 indicates no monotonic relationship between the variables.
- Spearman’s rank correlation is often used when the assumptions of Pearson correlation (such as linearity and normality) are not met, or when dealing with ordinal data or non-normally distributed data.
Kindly see the link for practical solution of this method :
Thanks a Lot.