Statistics made easy
8th revised edition (March 2026) - many illustrative examples - only €8.99
Spearman's rank correlation coefficient
Author: Dr. Hannah Volk-Jesussek
Updated:
What is Spearman rank correlation?
Spearman rank correlation measures the strength and direction of a monotonic relationship between two variables. It is the non-parametric counterpart of Pearson's correlation, so the variables do not need to be normally distributed. It can be used with ordinal or quantitative variables.
There is an important difference between the two correlation coefficients. Spearman correlation uses ranks rather than the original values, hence the name rank correlation.
Example of Spearman correlation
We measured the reaction time of 8 computer gamers and asked them about their age.
If we use a Pearson correlation, we simply take the two variables, reaction time and age, and calculate the Pearson correlation coefficient. However, we now want to calculate the Spearman rank correlation, so we first assign a rank to each person for reaction time and age.
The reaction time is already sorted by value. 12 is the smallest value, so it gets rank 1, 15 is the second smallest, so it gets rank 2 and so on. We do the same for age. When values are tied, each tied value receives the average of the ranks it would occupy.
Let's take a look at this in a scatter plot. On the left side we see the raw data for age and reaction time, and on the right side the ranks.
We studied 8 people, and because there are no tied values, we have 8 distinct ranks to assign. The ranks are evenly spaced, regardless of the distances between the original values.
To calculate the Spearman correlation, we simply calculate the Pearson correlation of the ranks. So the Spearman correlation is the same as the Pearson correlation, except that the ranks are used instead of the original values.
Let's look at this in numiqo. Click to load the example data.
Example dataOn one hand, we have reaction time and age; on the other, we have the newly created ranks for reaction time and age.
Now we can either calculate the Spearman rank correlation from the reaction time and age, or we can calculate the Pearson correlation from the ranks. In both cases we get a correlation of 0.9.
Spearman rank correlation and Kendall's tau
Kendall's tau is very similar to the Spearman correlation. Kendall's tau is often useful for small datasets and data with many ties, but neither coefficient is universally preferable.
Spearman Correlation Calculation
If there are no rank ties, this equation can also be used to calculate the Spearman correlation.
where n is the number of cases and d is the difference between the ranks of the two variables. For our example, the result is as follows:
The sum of di2 is 8 and n, which is the number of people, is also 8. Substituting these values, we get a correlation coefficient of 0.9.
Strength and direction of the Spearman coefficient
Like Pearson's correlation coefficient r, the Spearman correlation coefficient rs also varies between -1 and 1.
Using the coefficient, we can determine two things:
- The strength of the correlation and
- the direction of the correlation.
The strength of the correlation can be read from a table.
| Value of rs | Strength of correlation |
|---|---|
| 0.0 ≤ |rs| < 0.1 | no correlation |
| 0.1 ≤ |rs| < 0.3 | low correlation |
| 0.3 ≤ |rs| < 0.5 | medium correlation |
| 0.5 ≤ |rs| < 0.7 | high correlation |
| 0.7 ≤ |rs| ≤ 1 | very high correlation |
If we have a coefficient between -1 and 0, there is a negative correlation, that is, a negative relationship between the variables. If we have a coefficient between 0 and 1, there is a positive correlation, that is, a positive relationship between the two variables. A value of 0 indicates no monotonic relationship, although another type of relationship may still exist.
A correlation describes an association; by itself, it does not establish causation.
Testing the significance of correlation coefficients
Often our aim is to test a hypothesis about the population from a sample.
We have calculated the correlation coefficient for the sample data. We can now test whether the correlation coefficient is significantly different from 0.
The null hypothesis and the alternative hypothesis are as follows:
- Null hypothesis: the population rank correlation ρs = 0 (there is no monotonic association).
- Alternative hypothesis: the population rank correlation ρs ≠ 0 (there is a monotonic association).
For larger samples, whether the correlation is significantly different from zero can be tested approximately using the following t statistic. For small samples, an exact permutation test is preferable when available. In either case, the pairs of observations should be independent of one another.
Here, rs is the correlation coefficient and n is the sample size. An approximate p-value can then be calculated from the test statistic t. If the p-value is less than the specified significance level (usually 5%), then the null hypothesis is rejected; otherwise, it is not rejected.
Calculation with numiqo
If we use this approximation in numiqo for the example, we get a p-value of 0.002.
Therefore, the p-value is less than 0.05 and we can reject the null hypothesis that the correlation coefficient is zero in the population.
Statistics made easy
- many illustrative examples
- ideal for exams and theses
- statistics made easy on 464 pages
- 8th revised edition (March 2026)
Only €8.99
Free sample
"Super simple written"
"It could not be simpler"
"So many helpful examples"