In statistics, Spearman's rank correlation coefficient or Spearman's ρ is a number ranging from -1 to 1 that indicates how strongly two sets of ranks are correlated. It is used in situations where the ranking of a dataset is important, for instance in sports. If a statistician wanted to know whether people who are high ranking in sprinting are also high ranking in long-distance running, they would use a Spearman rank correlation coefficient. The coefficient is named after Charles Spearman and often denoted by the Greek letter ρ {\displaystyle \rho } (rho) or as r s {\displaystyle r_{s}} . It is a nonparametric measure of rank correlation (statistical dependence between the rankings of two variables). It assesses how well the relationship between two variables can be described using a monotonic function. The Spearman correlation between two variables is equal to the Pearson correlation between the rank values of those two variables; while Pearson's correlation assesses linear relationships, Spearman's correlation assesses monotonic relationships (whether linear or not). If there are no repeated data values, a perfect Spearman correlation of +1 or −1 occurs when each of the variables is a perfect monotone function of the other. Intuitively, the Spearman correlation between two variables will be high when observations have a similar (or identical for a correlation of 1) rank (i.e., relative position label of the observations within the variable: 1st, 2nd, 3rd, etc.) between the two variables, and low when observations have a dissimilar (or fully opposed for a correlation of −1) rank between the two variables. Spearman's coefficient is appropriate for both continuous and discrete ordinal variables. Both Spearman's ρ {\displaystyle \rho } and Kendall's τ {\displaystyle \tau } can be formulated as special cases of a more general correlation coefficient.
Applications The coefficient can be used to determine how well data fits a model, like when determining the similarity of text documents.
Definition and calculation The Spearman correlation coefficient is defined as the Pearson correlation coefficient between the rank variables. For a sample of size n , {\displaystyle \ n\ ,} the n {\displaystyle \ n\ } pairs of raw scores ( X i , Y i ) {\displaystyle \ \left(X_{i},Y_{i}\right)\ } are converted to ranks R [ X i ] , R [ Y i ] , {\displaystyle \ \operatorname {R} [X_{i}],\operatorname {R} [Y_{i}]\ ,} and r s {\displaystyle \ r_{s}\ } is computed as
r s = ρ [ R [ X ] , R [ Y ] ] = cov [ R [ X ] , R [ Y ] ] σ R [ X ] σ R [ Y ] , {\displaystyle r_{s}=\operatorname {\rho } {\bigl [}\ \operatorname {R} [X],\operatorname {R} [Y]\ {\bigr ]}={\frac {\ \operatorname {cov} {\bigl [}\ \operatorname {R} [X],\operatorname {R} [Y]\ {\bigr ]}\ }{\ \sigma _{\operatorname {R} [X]}\ \sigma _{\operatorname {R} [Y]}\ }},}
where
ρ {\displaystyle \operatorname {\rho } \ } denotes the conventional Pearson correlation coefficient operator, but applied to the rank variables,
cov [ R [ X ] , R [ Y ] ] {\displaystyle \operatorname {cov} {\bigl [}\ \operatorname {R} [X],\operatorname {R} [Y]\ {\bigr ]}\ } is the covariance of the rank variables,
… excerpt ends here. Continue reading the full article.






