Chapter 11 Spearman’s Rank Correlation

11.1 Usage

Spearman’s rank correlation (\(r_s\)) calculates the correlation between ranked observations.

  • \(r\) calculates the correlation between the pairs \((X_i,Y_i)\)
  • \(r_s\) calculates the correlation between the pairs \((~R(X_i),R(Y_i)~)\)

Assumptions

  • We must have independent paired observations.

We can’t measure the association of dependent data (i.e. time series).

11.1.1 How it Works

By comparing ranks of \(X_i\)’s to ranks of \(Y_i\)’s, we can see the extent to which \(Y\) increases or decreases with \(X\).

The p-value follows a similar permutation pattern as before. We can reshuffle the obser

11.1.2 p-value

  1. Reshuffle the \(Y_i\)’s to get new pairs \((X_i,Y^*_i)\)
  2. Calculate \(r^*_s\) for the permuted sample.
  3. Repeat steps 1 and 2, \(n!\) times to generate all possible permutations.
  4. p-value is the fraction of \({r}_s^*\)’s as or more extreme than observed:
Formal Hypothesis Test

Hypothesis Test: \[ \begin{aligned} H_0 &: \rho_s=0 \\ H_a &: \rho_s \geq 0, \rho_s \leq 0, \text{ or } \rho_s \neq 0 \end{aligned} \]

Note: \(\rho_s\) refers to the population measure, while \(r_s\) refers to the observed correlation measure.

P-Value: \[ \begin{array}{l} p_{\text {lower tail}}=\frac{\# r_{s}^{*} \leq r_{s, obs}}{n !} \\ p_{\text {upper tail}}=\frac{\# r_{s}^{*} \geq r_{s, obs}}{n !} \\ p_{\text {two sided}}=\frac{\# |r_{s}^{*}| \geq |r_{s, obs}|}{n !} \end{array} \]