18.8 Rank Randomization for Association
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 1 shows 5 values of X and Y. Table 2 shows these same data converted to ranks (separately for X and Y).
Table 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 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 2, the correlation between X and Y is 0.90. The correlation of ranks is called "Spearman's ρ."
Table 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 3). There are also three other arrangements that produce an r of 0.90 (see Tables 4, 5, and 6). Therefore, there are five arrangements of Y that lead to correlations as high or higher than the actual ranked data (Tables 2 through 6).
Table 4. Ranked data with correlation of 0.90.
| X | Y |
|---|---|
| 1 | 1 |
| 2 | 2 |
| 3 | 4 |
| 4 | 3 |
| 5 | 5 |
Table 5. Ranked data with correlation of 0.90.
| X | Y |
|---|---|
| 1 | 1 |
| 2 | 3 |
| 3 | 2 |
| 4 | 4 |
| 5 | 5 |
Table 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 ρ (in a new window).
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.
Adapted from Online Statistics Education: A Multimedia Course of Study (onlinestatbook.com), Project Leader: David M. Lane, Rice University. Developed with NSF support. The original work is in the public domain; it is cited here at the authors' request. Changes were made: reformatted as an accessible XYZ web edition with native MathML. License: Public-Domain.