Show that Spearman's rank correlation r lies between -1 and 1.
where $r = 1 - \frac{6 \sum d_i^2}{n(n^2 - 1)}$
For maximum r, d should be the least. So consider the ranks (x, y) like:
x y d 1 1 0 2 2 0 3 3 0 ... ... ... n n 0
So, $\sum d^2 =0$ and $r=1$
For minimum r, consider the ranks like:
x y d n 1 n-1 n-1 2 n-3 n-2 3 n-4 ... ... ... 1 n 1-n
We can write $d_i = n + 1 - 2i$
$$\begin{align} & \sum_{i=1}^n d_i^2 \\ &= \sum_{i=1}^n (n + 1 - 2i)^2 \\ &= \sum ((n + 1)^2 - 4(n + 1)i + 4i^2) \\ &= \frac n3 (n^2+1) \end{align}$$
Plugging into the formula of r, we get $r=-1$
Copyright © 2021 JogjaFile Inc.
For maximum r, d should be the least. So consider the ranks (x, y) like:
So, $\sum d^2 =0$ and $r=1$
For minimum r, consider the ranks like:
We can write $d_i = n + 1 - 2i$
$$\begin{align} & \sum_{i=1}^n d_i^2 \\ &= \sum_{i=1}^n (n + 1 - 2i)^2 \\ &= \sum ((n + 1)^2 - 4(n + 1)i + 4i^2) \\ &= \frac n3 (n^2+1) \end{align}$$
Plugging into the formula of r, we get $r=-1$