# 18.8: Rank Randomization for Association

- Page ID
- 2511

Skills to Develop

- Compute Spearman's \(ρ\)
- Test Spearman's \(ρ\) for significance

The rank randomization test for association is equivalent to the randomization test for Pearson's r except that the numbers are converted to ranks before the analysis is done. Table \(\PageIndex{1}\) shows \(5\) values of \(X\) and \(Y\). Table \(\PageIndex{2}\) shows these same data converted to ranks (separately for \(X\) and \(Y\)).

**Table \(\PageIndex{1}\):** Example data

X | Y |
---|---|

1.0 | 1.0 |

2.4 | 2.0 |

3.8 | 2.3 |

4.0 | 3.7 |

11.0 | 2.5 |

**Table \(\PageIndex{2}\): **Ranked data

X | Y |
---|---|

1 | 1 |

2 | 2 |

3 | 3 |

4 | 5 |

5 | 4 |

The approach is to consider the \(X\) variable fixed and compare the correlation obtained in the actual ranked data to the correlations that could be obtained by rearranging the \(Y\) variable ranks. For the ranked data shown in Table \(\PageIndex{2}\), the correlation between \(X\) and \(Y\) is \(0.90\). The correlation of ranks is called "Spearman's \(ρ\)."

**Table \(\PageIndex{3}\):** Ranked data with correlation of \(1.0\)

X | Y |
---|---|

1 | 1 |

2 | 2 |

3 | 3 |

4 | 4 |

5 | 5 |

There is only one arrangement of \(Y\) that produces a higher correlation than \(0.90\): A correlation of \(1.0\) results if the fourth and fifth observations' \(Y\) values are switched (see Table \(\PageIndex{3}\)). There are also three other arrangements that produce an \(r\) of \(0.90\) (see Tables \(\PageIndex{4}\), \(\PageIndex{5}\), and \(\PageIndex{6}\)). Therefore, there are five arrangements of \(Y\) that lead to correlations as high or higher than the actual ranked data (Tables \(\PageIndex{2}\) through \(\PageIndex{6}\)).

**Table \(\PageIndex{4}\):** Ranked data with correlation of \(0.90\)

X | Y |
---|---|

1 | 1 |

2 | 2 |

3 | 4 |

4 | 3 |

5 | 5 |

**Table \(\PageIndex{5}\):** Ranked data with correlation of \(0.90\)

X | Y |
---|---|

1 | 1 |

2 | 3 |

3 | 2 |

4 | 4 |

5 | 5 |

**Table \(\PageIndex{6}\):** Ranked data with correlation of \(0.90\)

X | Y |
---|---|

1 | 2 |

2 | 1 |

3 | 3 |

4 | 4 |

5 | 5 |

The next step is to calculate the number of possible arrangements of \(Y\). The number is simply \(N!\), where \(N\) is the number of pairs of scores. Here, the number of arrangements is \(5! = 120\). Therefore, the probability value is \(5/120 = 0.042\). Note that this is a one-tailed probability since it is the proportion of arrangements that give a correlation as large or larger. The two-tailed probability is \(0.084\).

Since it is hard to count up all the possibilities when the sample size is even moderately large, it is convenient to have a table of critical values.

Table of critical values for Spearman's \(\rho \)

From the table linked to above, you can see that the critical value for a one-tailed test with \(5\) observations at the \(0.05\) level is \(0.90\). Since the correlation for the sample data is \(0.90\), the association is significant at the \(0.05\) level (one-tailed). As shown above, the probability value is \(0.042\). Since the critical value for a two-tailed test is \(1.0\), Spearman's \(ρ\) is not significant in a two-tailed test.

### Contributor

Online Statistics Education: A Multimedia Course of Study (http://onlinestatbook.com/). Project Leader: David M. Lane, Rice University.