Formula
1. `r = 1 - (6 * sum d^2)/(n(n^2 - 1))`
|
Examples
3. Calculate Spearman's Rank Correlation Coefficient from the following Rank
X | 1 | 6 | 5 | 10 | 3 | 2 | 4 | 9 | 7 | 8 |
Y | 3 | 5 | 8 | 4 | 7 | 10 | 2 | 1 | 6 | 9 |
Y | 6 | 4 | 9 | 8 | 1 | 2 | 3 | 10 | 5 | 7 |
Solution:
Rank Correlation of X and Y
`Rx` | `Ry` | `d=Rx-Ry` | `d^2` |
1 | 3 | -2 | 4 |
6 | 5 | 1 | 1 |
5 | 8 | -3 | 9 |
10 | 4 | 6 | 36 |
3 | 7 | -4 | 16 |
2 | 10 | -8 | 64 |
4 | 2 | 2 | 4 |
9 | 1 | 8 | 64 |
7 | 6 | 1 | 1 |
8 | 9 | -1 | 1 |
--- | --- | --- | --- |
-- | -- | -- | 200 |
`r = 1 - (6 * sum d^2)/(n(n^2 - 1))`
`=1 - (6 * 200)/(10 * (10^2 - 1))`
`=1 - (6 * 200)/(10 * (100 - 1))`
`=1 - 1200/990`
`=1 - 1.2121`
`=-0.2121`
Rank Correlation of Y and Z
`Rx` | `Ry` | `d=Rx-Ry` | `d^2` |
3 | 6 | -3 | 9 |
5 | 4 | 1 | 1 |
8 | 9 | -1 | 1 |
4 | 8 | -4 | 16 |
7 | 1 | 6 | 36 |
10 | 2 | 8 | 64 |
2 | 3 | -1 | 1 |
1 | 10 | -9 | 81 |
6 | 5 | 1 | 1 |
9 | 7 | 2 | 4 |
--- | --- | --- | --- |
-- | -- | -- | 214 |
`r = 1 - (6 * sum d^2)/(n(n^2 - 1))`
`=1 - (6 * 214)/(10 * (10^2 - 1))`
`=1 - (6 * 214)/(10 * (100 - 1))`
`=1 - 1284/990`
`=1 - 1.297`
`=-0.297`
Rank Correlation of Z and X
`Rx` | `Ry` | `d=Rx-Ry` | `d^2` |
6 | 1 | 5 | 25 |
4 | 6 | -2 | 4 |
9 | 5 | 4 | 16 |
8 | 10 | -2 | 4 |
1 | 3 | -2 | 4 |
2 | 2 | 0 | 0 |
3 | 4 | -1 | 1 |
10 | 9 | 1 | 1 |
5 | 7 | -2 | 4 |
7 | 8 | -1 | 1 |
--- | --- | --- | --- |
-- | -- | -- | 60 |
`r = 1 - (6 * sum d^2)/(n(n^2 - 1))`
`=1 - (6 * 60)/(10 * (10^2 - 1))`
`=1 - (6 * 60)/(10 * (100 - 1))`
`=1 - 360/990`
`=1 - 0.3636`
`=0.6364`
`r_1 = -0.2121, r_2 = -0.297, r_3 = 0.6364`
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then