Spearman's Rank Correlation Coefficient
Spearman's rank correlation coefficient measures the strength and direction of the monotonic association between two variables by applying the correlation idea to the ranks of the observations. This lesson covers the rank-difference formula, computation with and without tied ranks, and recovering from a given .
Tutorial
Ranks and the Spearman Formula
When the relationship between two variables is monotonic but not necessarily linear, Pearson's can understate the association. The Spearman rank correlation coefficient fixes this by measuring correlation between the ranks of the observations rather than the raw values.
To compute when no two -values are tied and no two -values are tied:
- Rank the -values from smallest (rank ) to largest (rank ). Do the same independently for the -values.
- For each pair compute the rank difference
- Apply the formula
The value of always lies between and It equals exactly when the two rankings are identical (perfect monotonic increase) and when one ranking is the exact reverse of the other (perfect monotonic decrease).
Tiny example. With and the data
the rank differences are so and