Spearman's rank correlation test, also known as Spearman's rho, is a nonparametric method for assessing the strength and direction of association between two variables. This test is particularly valuable when the data distribution is unknown or when the assumption of normality does not hold. Named after the English psychologist and statistician Dr. Charles Edward Spearman, it serves as the nonparametric counterpart to Pearson's correlation coefficient.
Spearman's test calculates correlation by using ranks instead of raw data values, which makes it more flexible and robust than Pearson's. Unlike Pearson's correlation, which only measures linear relationships and assumes normally distributed data, Spearman's correlation can detect both linear and non-linear monotonic associations. It is also suitable for both continuous and discrete ordinal data, making it applicable in a wider range of scenarios where traditional parametric assumptions may not be met.
Spearman's rho ranges from -1 to +1, where the sign indicates the direction of the relationship: a negative sign shows an inverse correlation and a positive sign shows a direct correlation. When ranks are distinct, Spearman's rho is calculated using the formula:

Where d is the difference between the ranks for the two variables within a pair, and n is the sample size (total number of sample data pairs). To perform the test, the statistic rs is compared with the critical values at a specific significance level (usually at α = 0.05). These critical values are obtained from the standard table when the sample size is below 30 (i.e., n ≤ 30).
Spearman's rank correlation test is one of the most widely used correlation methods due to its robustness and versatility. It has an efficiency rating of approximately 0.91 when compared to Pearson's correlation coefficient, assuming all parametric requirements are met. This rating implies that Spearman's rho achieves comparable results to Pearson's correlation; for instance, using Spearman's rho with 100 data pairs can yield results similar to those from Pearson's correlation with 91 pairs. However, this efficiency measure does not mean that Spearman's test is only 91% accurate or correct only 91% of the time. Instead, it reflects the relative effectiveness of Spearman's test in capturing correlation strength compared to its parametric counterpart.
Spearman's rank correlation is a nonparametric test used to find the association between two variables in paired data.
Consider an example of finding a correlation between the eggshell thickness and the hatching order for 35 turtle eggs.
Here, the hatching order cannot be measured parametrically. Instead, it can only be ranked based on its order. Similarly, the eggshell thickness can be ranked in increasing order of thickness measured after hatching.
To conduct the test, we begin with the null hypothesis that there is no correlation between the two variables and the alternative hypothesis that a correlation exists between them.
The quantity Rho-sub-S or Spearman's rank correlation coefficient is a population parameter estimated from the sample statistic R-sub-S using the following equation.
The sample size is more than 30, so the critical value is calculated using the following equation.
Notice the sample statistic is beyond the threshold of the critical value, suggesting that there is a correlation between eggshell thickness and hatching order.