Definitionintro
Spearman's rank correlation coefficient
Also called Spearman's rho, Spearman correlation.
The Pearson correlation of the ranks of two variables. It measures monotone association and is the basis of a rank test of independence.
Spearman's rank correlation coefficient of paired data is the ordinary (Pearson) correlation coefficient of the ranks of the values and the ranks of the values. It is when is a strictly increasing function of , when it is a strictly decreasing one, and near 0 when the order of the values has nothing to do with the order of the values. Because only ranks enter, it does not change under increasing transformations of either variable, and a single extreme value moves it by a bounded amount. Under independence of and , the ranks of the values are a uniform random permutation relative to those of the values, so has an exact null law that depends only on , and it gives a permutation test of independence.
Definition
Let be the rank of among and the rank of among . Tied values get the average of the ranks they cover, the midrank. Both rank vectors have mean . Spearman's rank correlation coefficient is
defined when neither variable is constant. Without ties, both sums of squares equal , and with ,
With ties this short formula is not the correlation of the midranks.
Null law. If the pairs are independent and is independent of , with continuous distributions, then given the ranks , the vector is a uniform random permutation of . So the law of is that of for a uniform random permutation , the same for every pair of continuous distributions. Its mean is 0 and its variance is . With ties, the same holds conditionally on the midranks, with the midranks of permuted. The test of independence rejects for large , or for large or small in one direction, with p-values from this law, computed by counting permutations for small , by sampling permutations, or from the approximation .
Population version. For a pair with continuous marginal distribution functions and , , and as .
Examples and non-examples
A small sample. Hours of study and scores . The ranks are and , so , and . The Pearson correlation of the raw values is , and Kendall's tau is .
Monotone but not linear. For and , , since the order is the same. The Pearson correlation is , because the relation is far from a line.
One extreme value. For and , and the Pearson correlation is . Replace by : stays , since is still the largest value, while the Pearson correlation drops to .
Ties. For and , the midranks are and . The correlation of the midranks is . The short formula gives , a different number.
The exact null law for . The 24 permutations give with counts , so takes the values , and the law is symmetric about 0. , so with four pairs no one-sided test at level can reject. Counting all permutations gives the upper 5% points below; each is the smallest value with :
| 5 | 0.9 | 0.0417 |
| 6 | 0.8286 | 0.0292 |
| 7 | 0.7143 | 0.0440 |
| 8 | 0.6429 | 0.0481 |
| 9 | 0.6 | 0.0484 |
The same counts confirm the mean 0 and the variance for . For , , and the normal approximation with standard deviation gives .
A population value. For a bivariate normal pair with correlation , , which is for . In a Monte Carlo run with pairs, samples and seed 81, the mean of was .
Non-example: a relation that is not monotone. For and , , although is a function of . measures monotone association only; does not mean independence.
Non-example: Pearson's coefficient. The Pearson correlation of the raw values measures linear association and can change under increasing transformations, as the examples above show. Spearman's coefficient is Pearson's coefficient applied to the ranks, not to the values.
Related definitions
- Kendall's tau. The share of concordant minus the share of discordant pairs, a linear function of the Kendall tau distance between the two rankings. Enumeration of all permutations for found , with both ends reached. See also comparing rankings with Kendall's tau.
- Spearman's footrule. , the footrule distance, with absolute differences in place of squares.
- Kendall's coefficient of concordance. For rankings of the same items, measures agreement, and the mean of the pairwise Spearman coefficients is . Its test is the Friedman test.
- Rank tests of association. For categorical data the chi-squared test of independence plays the role that the Spearman test plays for ordered data.
References
- C. Spearman, The proof and measurement of association between two things, American Journal of Psychology 15(1), 1904, pp. 72 to 101 (the measurement of correlation from the ranks of the two variables)
- Myles Hollander, Douglas A. Wolfe and Eric Chicken, Nonparametric Statistical Methods, third edition, Wiley, 2014, The chapter on the independence problem (the Spearman rank correlation test, its exact null law and its large-sample approximation)
- E. L. Lehmann, Nonparametrics, Statistical Methods Based on Ranks, revised edition, Springer, 2006, The chapter on tests of randomness and independence (the rank correlation statistics and their null laws)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 5M1BYQ Edit this page History Report an error Markdown