Derive Spearman's rank correlation formula (36), page 271 .
Here we are considering $n x$ values (e.g., weights) and $n$ corresponding $y$ values (e.g., heights). Let $x_j$ be the rank given to the $j$ th $x$ value, and $\mathrm{y}_j$ the rank given to the $j$ th $y$ value. The ranks are the integers 1 through $n$. The mean of the $x_j$ is then
$$
\bar{x}=\frac{1+2+\cdots+n}{n}=\frac{n(n+1) / 2}{n}=\frac{n+1}{2}
$$
while the variance is $$
\begin{aligned}
s_x^2=x^2-x^2 & =\frac{1^2+2^2+\cdots+n^2}{n}-\left(\frac{n+1}{2}\right)^2 \\
& =\frac{n(n+1)(2 n+1) / 6}{n}-\left(\frac{n+1}{2}\right)^2 \\
& =\frac{n^2-1}{12}
\end{aligned}
$$
using the results 1 and 2 of Appendix A. Similarly, the mean $\bar{y}$ and variance $s_y^2$ are equal to $(n+1) / 2$ and $\left(n^2-1\right) / 12$, respectively.
Now if $d_j=x_j-y_j$ are the deviations between the ranks, the variance of the deviations, $s_d^3$, is given in terms of $s_s^2, s_Y^2$ and the correlation coefficient between ranks by
$$
s_d^2=s_x^2+s_y^2-2 r_{\text {ramk }} s_x s_y
$$
Then
$$
r_{\text {ramk }}=\frac{s_x^2+s_y^2-s_y^2}{2 s_x s_y}
$$
Since $\bar{d}=0, s_j=\left(\Sigma d^d\right) / n$ and (1) becomes (2)
$$
r_{\text {rank }}=\frac{\left(n^2-1\right) / 12+\left(n^2-1\right) / 12-\left(\sum d^2\right) / n}{\left(n^2-1\right) / 6}=1-\frac{6 \sum d^2}{n\left(n^2-1\right)}
$$