If we have outliers, Pearson's correlation coefficient will be greatly
affected. Also, Pearson's correlation coefficient only measures linear
relationships between variables. There is another alternative.
Spearman's rank correlation coefficient
does not use the
actual observed data, but the ranks of the data, to compute a
correlation coefficient. That is, replace the smallest X value with
a 1, the next smallest with a 2, and so on. Repeat the same procedure
for the Y values. Then instead of having our data (X,Y) in the
form
they will be as follows
The formula for
is as follows,
Actually, this is just Pearson's formula applied to the ranks.