5.3 Spearmans Rank Correlation
In studying the relationship between two variables, a measure of correlation assumes that neither
variable is functionally dependent on the other e.g we must ask whether body weight is related to
height for a 35 year old man or exam scores in music are related to exam scores in mathematics for
first year college students.
If the distributions underlying the variables are far from bivariate normal, or if the data are ordinal,
then non-parametric correlation techniques should be employed to test hypothesis about the
relationship of the variables.
The assumptions underlying non-parametric correlation are:
- (i).
- the \(n\) pairs of ratio, interval or ordinal data constitute a random sample;
- (ii).
- the two members of each pair are measured on the same subject.
Nothing is assumed about the shape of either distribution, which is the whole point: Pearson’s coefficient requires bivariate normality before its significance test is valid, and these methods require none.
The rank correlation coefficient proposed by C. Spearman is Pearson’s coefficient computed on the
ranks of the observations rather than on the observations themselves.
The Spearman rank correlation coefficient computed from a sample is written \(r_s\). Then the parameter is
denoted as \(\rho _s\).
If each of the \(n\) measurements of \(X_i\) (i.e \(X_1,\dots ,X_n\)), then \(R(X_i)\) represents the rank of \(X_i\) where each \(i\in \mathbb {Z}\) each rank is a integer \(1,\dots ,n\)
indicating relative magnitude.
| Person | Weight\((X_i)\) | Height\((Y_i)\) | \(R(X_i)\) | \(R(Y_i)\) | \(d_i=R(X_i)-R(Y_i)\) | \(d_i^2\) |
| 1 | 75.8 | 1.59 | 2 | 1 | 1 | 1 |
| 2 | 77.2 | 1.66 | 3 | 2 | 1 | 1 |
| 3 | 89.3 | 1.82 | 5 | 4 | 1 | 1 |
| 4 | 72.2 | 1.73 | 1 | 3 | \(-2\) | 4 |
| 5 | 81.5 | 1.91 | 4 | 5 | \(-1\) | 1 |
| \(\sum d_i = 0\) | \(\sum d_i^{2} = 8\) | |||||
Example 5.2. Completing the table above: the weights rank \(2,3,5,1,4\) and the heights \(1,2,4,3,5\), giving differences \(d_i = 1, 1, 1, -2, -1\) with \(\sum d_i^{2} = 8\). (The differences must sum to zero, since both rankings use each of \(1,\ldots ,n\) exactly once — a useful check.) With \(n = 5\), \[r_s = 1 - \dfrac {6\sum d_i^{2}}{n^{3}-n} = 1 - \dfrac {6(8)}{125-5} = 1 - \dfrac {48}{120} = 0.6 .\]
Is it significant? With \(n = 5\) there are only \(5! = 120\) equally likely rankings under \(H_0\) of no association, so the null distribution is exact: \[P\left (r_s \geq 0.6\right ) = \dfrac {21}{120} = 0.175 ,\] giving a two-sided \(P\)-value of \(0.35\). We do not reject \(H_0\).
Indeed at \(n = 5\) the smallest one-sided significant value at \(5\%\) is \(r_s = 0.9\): with five pairs, nothing short of near-perfect agreement can be detected. A correlation of \(0.6\) sounds substantial and, on this much data, means almost nothing.
Questions on this section
Stuck on something here? Ask below and it stays attached to this topic.