Introduction to Research Design and Statistics

Permutation Tests


For most hypothesis tests, we start with the assumptions and work forward to derive the sampling distribution of the test statistic under the null hypothesis. For permutation tests we will reverse the procedure, since the sampling distribution involves the permutations which give the procedure its name and are the key theoretical issue in understanding the test.

In mathematics, a permutation is a reordering of the numbers 1, ..., n. For example,

are all permutations of the numbers 1 through 6 (note that this includes the standard order in first line). There are n! (n factorial) permutations of n objects. In this case, 6! = 720, so you can see why they aren't all written out here.

The term permutation tests refers to rearrangements of the data. The null hypothesis of the test specifies that the permutations are all equally likely. A concise way to say this is that the distribution of the data under the null hypothesis satisfies exchangeability.

The sampling distribution of the test statistic under the null hypothesis is computed by forming all or many of the permutations, calculating the test statistic for each and considering these values all equally likely.

Consider the following two group example.

Group 1: 55 58 60
Group 2: 12 22 34

Clearly a t-test will not work with this small example, however a permutation test will do the job.

Here are the steps we will follow to use a permutation test to analyze the differences between the two groups.

  1. Analyze the problem
  2. Choose a test statistic
  3. Resample and recompute the test statistic
  4. Reject or fail to reject the null hypothesis
For the original order the sum for Group 1 is 173. In this example, if the groups were truly equal then ramdomly moving the observations among the groups would make no difference in the sum for Group 1. Some of the sums would be a little larger than the original sum and some would be a bit smaller. For the six observations there are 720 permutations of which there are 20 distinct combinations for which we can compute the sum of Group 1. Of these 20 different orderings only one has a Group 1 sum that greater than or equal to the Group 1 sum from our original ordering. Therefor the probability that a sum this large or larger would occur by chance alone is 1/20 = 0.05 and can be considered to be statistically significant.

In this case the permutation yielded an exact test because we were able to enumerate all of the possible combinations. We will also demonstrate this using the Stata permute command using the data from above. The permute command randomly places observations into groups so we will use 200 replications to insure that all combinations have a chance to be present.

In larger examples it won't be possible to enumerate every permutaion so we will have to take numerous random orderings. We will demonstrate this using the Stata permute command with the hsb2 dataset with 1,000 replications.


Intro Home Page

Phil Ender, 23mar06, 9Jun04, 30Jun98