- Introduced by
- Charles Spearman
- Year
- 1904
- Type
- Nonparametric rank-based correlation
What does it do?
The Spearman rank correlation coefficient (ρ) is a nonparametric measure of the monotonic association between two variables.
Introduced by Charles Spearman in 1904, it converts raw observations to ranks and measures how consistently one variable increases as the other increases, without assuming a normal distribution or a linear relationship.
The intuition behind the method
Imagine lining up students by their score on one test and then by their score on another. If the two rankings tend to match, with the students at the top of one list also near the top of the other, the Spearman correlation is close to +1. If the rankings are reversed, it approaches −1. The method replaces actual values with their ranks, so extreme values have less leverage on the result than in a standard Pearson correlation, although they can still shift ranks and the coefficient, particularly in small samples.
History
Charles Spearman introduced the rank correlation coefficient in 1904 in The American Journal of Psychology, in the paper 'The proof and measurement of association between two things'. Because the statistic is defined on ranks rather than raw values, it can be applied to ordinal as well as continuous data. It has since become a standard nonparametric association measure across the empirical sciences.
When to use it
Use Spearman's correlation when you want to measure the association between two variables that are at least ordinal in scale and when you cannot confidently assume normality or a linear relationship. It is a suitable choice when the data contain outliers, when the relationship is monotonic but not strictly linear, or when one or both variables are measured on an ordinal scale such as Likert items or ranked preferences. The minimum recommended sample is 10 observations; if n is smaller than 10, Kendall's tau is a more reliable alternative. Inspect a scatter plot first: if the relationship is non-monotonic (for example U-shaped or cyclical), neither Spearman nor Pearson is appropriate.
Limitations and considerations
- Detects only monotonic associations; non-monotonic patterns (e.g. U-shaped) yield ρ near zero even when a strong relationship exists.
- Ranks discard magnitude information: a large gap and a small gap between adjacent values contribute in the same way, so the size of differences is lost.
- Less statistically powerful than Pearson correlation when the data are truly bivariate normal.
- With many tied ranks the closed-form d² expression is inexact, so the tie-corrected rank-based Pearson calculation must be used instead.
- With fewer than 10 observations the estimate and its significance test are unreliable.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Requires no normality or linearity assumption, so it applies to any monotonic relationship.
- Because it operates on ranks, extreme values have less influence on the coefficient than they have on Pearson's r, although outliers can still change the ranks and the estimate, particularly in small samples.
- Applicable to ordinal variables, such as Likert items or ranked preferences, for which the arithmetic underlying Pearson's formula is not meaningful.
- The same procedure handles both continuous and ordinal data.
Applications
- Measuring the association between two psychometric scales or survey subscores when normality cannot be assumed.
- Assessing the relationship between ranked exam performance and a continuous predictor in educational research.
- Examining whether two raters' ordinal rankings of the same objects move together, which measures association rather than exact agreement.
- Testing whether a biomarker and a clinical severity score covary monotonically in medical studies.
- Investigating the link between socioeconomic indicators and health or environmental outcomes in social science.
How it works
How it works
The null hypothesis states that there is no monotonic association between the two variables in the population (ρ = 0). The alternative states that a monotonic association exists, either positive or negative. A monotonic relationship means that as one variable increases, the other consistently increases or consistently decreases, though not necessarily at a constant rate.
Formula
H_0:\ \rho_s = 0 \quad H_1:\ \rho_s \neq 0
Each observation is replaced by its rank within its own variable, and the statistic is computed from the differences d_i between the two rank sequences. When there are no tied values, the closed-form expression ρ = 1 − 6Σd²/n(n²−1) gives the result directly. When ties are present, the closed form is no longer exact; ρ is instead computed as the Pearson correlation of the two rank vectors, with tied observations assigned the average of the ranks they would have occupied. The result always lies between −1 and +1.
Formula
\rho_s = 1 - \dfrac{6\sum d_i^2}{n(n^2 - 1)}The coefficient is converted to a t statistic, t = ρ√((n−2)/(1−ρ²)), which is referred to a t distribution with n − 2 degrees of freedom to obtain an approximate p-value. This reference distribution is an asymptotic approximation, so the p-value is approximate, particularly for small samples or when many values are tied. In those cases exact or permutation-based p-values are preferable, and the method used should be stated. If p falls below 0.05, the null hypothesis of no monotonic association is rejected. Because a significant result only indicates a statistically detectable association, report ρ together with its p-value and a 95% confidence interval, and state the method used to compute the interval. A practical choice is a bootstrap percentile interval: resample the paired observations with replacement a large number of times, recompute ρ in each resample, and take the 2.5th and 97.5th percentiles of the resampled values as the limits. For interpretation, |ρ| below 0.30 is conventionally weak, 0.30 to 0.49 moderate, and 0.50 or above strong; these cut-offs are conventions and vary by discipline.
Formula
t = \rho_s\sqrt{\dfrac{n-2}{1-\rho_s^2}};\quad \text{reject } H_0 \text{ if } p < 0.05Common pitfalls
- Skipping the scatter plot and applying Spearman without checking that the relationship is monotonic.
- Reporting ρ without a p-value and confidence interval, leaving the reader unable to judge statistical significance.
- Interpreting a significant ρ as evidence of causation rather than association.
- Reading a near-zero ρ as 'no relationship' when the relationship might be non-monotonic.
- Applying the closed-form d² formula to data with ties, which gives a different value from the tie-corrected calculation.
Frequently asked questions
When should I use Spearman instead of Pearson?
Use Spearman when you cannot assume bivariate normality, when one or both variables are ordinal, or when the data contain influential outliers. Pearson is more powerful under normality and linearity, but a single extreme value can distort it badly. If in doubt, examine the scatter plot and run a normality check.
What does ρ = 0.45 mean in practice?
It indicates a moderate positive monotonic association: when one variable increases, the other tends to increase as well, but the pattern is not tight enough to be considered strong. By convention, |ρ| below 0.30 is weak, 0.30 to 0.49 is moderate, and 0.50 or above is strong, though these thresholds depend on the discipline.
How do I handle ties in the data?
Tied observations receive the average of the ranks they would have occupied. When ties are present, compute ρ as the Pearson correlation of the rank vectors rather than with the d² closed form, which assumes there are no ties. Most statistical software does this automatically.
Can I use Spearman correlation to compare more than two variables at once?
Spearman's ρ is a pairwise measure; it quantifies the association between exactly two variables at a time. For multiple variables, compute a correlation matrix of pairwise ρ values. Adjust p-values for multiple comparisons (e.g. with the Bonferroni or FDR correction) to avoid inflated false-positive rates.
Related methods
Sources
Spearman, C. (1904). The proof and measurement of association between two things. The American Journal of Psychology, 15, 72–101.
Open DOI reference