Lably
Skip to content

Permutation test

Exact statistical hypothesis test

  • 10 min read
  • 7 chapters

Related on Lably

Through Statistical hypothesis test, Student's t-test and Chi-squared test

Permutation tests can be understood as surrogate data testing where the surrogate data under the null hypothesis are obtained through permutations of the original data.

In other words, the method by which treatments are allocated to subjects in an experimental design is mirrored in the analysis of that design. If the labels are exchangeable under the null hypothesis, then the resulting tests yield exact significance levels; see also exchangeability. Confidence intervals can then be derived from the tests. The theory has evolved from the works of Ronald Fisher and E. J. G. Pitman in the 1930s.

Permutation tests should not be confused with randomized tests.

Method

To illustrate the basic idea of a permutation test, suppose we collect random variables XA and XB for each individual from two groups A and B whose sample means are x¯A and x¯B, and that we want to know whether XA and XB come from the same distribution. Let nA and nB be the sample size collected from each group. The permutation test is designed to determine whether the observed difference between the sample means is large enough to reject, at some significance level, the null hypothesis H0 that the data drawn from A is from the same distribution as the data drawn from B.

The test proceeds as follows. First, the difference in means between the two samples is calculated: this is the observed value of the test statistic, Tobs.

Next, the observations of groups A and B are pooled, and the difference in sample means is calculated and recorded for every possible way of dividing the pooled values into two groups of size nA and nB (i.e., for every permutation of the group labels A and B). The set of these calculated differences is the exact distribution of possible differences (for this sample) under the null hypothesis that group labels are exchangeable (i.e., are randomly assigned).

The one-sided p-value of the test is calculated as the proportion of sampled permutations where the difference in means was greater than Tobs. The two-sided p-value of the test is calculated as the proportion of sampled permutations where the absolute difference was greater than |Tobs|. Many implementations of permutation tests require that the observed data itself be counted as one of the permutations so that the permutation p-value will never be zero.

Alternatively, if the only purpose of the test is to reject or not reject the null hypothesis, one could sort the recorded differences, and then observe if Tobs is contained within the middle (1−α)×100% of them, for some significance level α. If it is not, we reject the hypothesis of identical probability curves at the α×100% significance level.

To exploit variance reduction with paired samples, a paired permutation test must be applied, see paired difference test. This is equivalent to performing a normal, unpaired permutation test, but restricting the set of valid permutations to only those which respect the paired nature of the data by forbidding both halves of any pair from being included in the same partition. In the specific but common case where the test statistic is the mean, this is also equivalent to computing a single set of differences of each pair and iterating over all of the 2n sign-reversals instead of the usual partitioning approach.

Sign in to keep reading

6 more chapters are free with a Lably account.

More in Statistics