x | y |
---|---|
10 | 3.0 |
10 | 3.0 |
4 | 1.0 |
20 | 2.0 |
30 | 3.0 |
40 | 4.5 |
40 | 5.0 |
30 | 6.0 |
20 | 7.0 |
10 | 1.0 |
Spearman’s rank correlation
Pearson’s correlation coefficient: at least interval level of measurement for the data
Spearman’s rank correlation: at least ordinal-level or ranked data
\(r = 1 - \frac{6\sum_{i=1}^nd^2}{n(n^2-1)}\)
where
\(n = \text{number of pairs being correlated.}\)
\(d = \text{the difference in the ranks of each pair}\)
Compute Spearman’s rank correlation for the following variables to determine the degree of association between the two variables.
x | y |
---|---|
10 | 3.0 |
10 | 3.0 |
4 | 1.0 |
20 | 2.0 |
30 | 3.0 |
40 | 4.5 |
40 | 5.0 |
30 | 6.0 |
20 | 7.0 |
10 | 1.0 |
Pearson’s correlation determines the strength and direction of the linear relationship between two variables.
Spearman’s correlation determines the strength and direction of the monotonic relationship.
The Spearman’s rank correlation formula is derived from the Pearson product moment formula and utilises the ranks of the \(n\) pairs instead of the raw data.
Monotonic vs Non-monotonic
Monotonic & Non-linear vs Monotonic & Linear