## Spearman Correlation formula

## What is the definition of the Spearman Correlation test?

\[\rho = r_s = 1 - \frac{6\sum{d^2_i}}{n(n^2-1)}\]

*p*: Spearman correlation*r*: Spearman correlation_{s }*d*: rg(X_{i}_{i}) - rg(Y_{i}): difference between the two ranks of each observation (for example, one can have the second best score on variable X, but the ninth on variable Y.)*n*: number of scores

Note: if there are tied ranks, the following method can be used to calculate the Spearman Correlation:

\[\rho = \frac{\sum_i (x_i - \bar{x})(y_i - \bar{y})}{\sqrt {\sum_i (x_i - \bar{x})^2 \sum_i (y_i - \bar{y})^2}}\]

## Add new contribution