Randomization
Tests
Learn how to test hypotheses by simulating random chance and comparing observed results to what we'd expect if the null hypothesis were true.
What Is a Randomization Test?
A randomization test (also called a permutation test) is a method of hypothesis testing that does not rely on theoretical distributions like the normal or \( t \)-distribution. Instead, it builds a reference distribution by repeatedly shuffling the data under the assumption that the null hypothesis is true.
Why Use Randomization?
Key Vocabulary
The Core Logic
The Formal Framework
For a two-group comparison with observed difference \( d_{\text{obs}} = \bar{x}_1 - \bar{x}_2 \):
Randomization vs. Traditional Tests
| Randomization Test | Traditional \( t \)-test | |
|---|---|---|
| Distribution assumed | None (distribution-free) | Normal (or large \( n \)) |
| Reference distribution | Simulated by shuffling data | Theoretical \( t \)-distribution |
| Small samples | Works well | May be unreliable |
| Computation | Requires many simulations | Single formula calculation |
| Flexibility of statistic | Any statistic | Typically mean-based |
How to Conduct a Randomization Test
Example 1: Sleep Study
A researcher tests whether a new herbal supplement improves sleep. 10 subjects receive the supplement (Treatment) and 10 receive a placebo (Control). Hours of sleep recorded:
Simulating Under \( H_0 \)
Example 2: Gender Pay Gap
A company's HR department wants to know if there's a significant salary difference between male and female employees in the same role. They sample 15 men and 12 women.
Example 2: Result
We pool all 27 salary values, randomly assign 15 to "Men" and 12 to "Women," compute \( d^* \), and repeat 10,000 times. This is a two-sided test, so we count simulations where \( |d^*| \geq |5{,}300| \).
Example 3: Proportions
Randomization tests aren't just for means. A clinical trial tests a new drug: 18 of 30 patients improved on the drug vs. 11 of 30 on placebo.
Interpreting the p-value
Common Mistakes
Summary Checklist
| Concept | Key Detail |
|---|---|
| Purpose | Test a hypothesis without distributional assumptions |
| Null Hypothesis | Group labels are interchangeable (no real effect) |
| Test Statistic | Any summary: \( \bar{x}_1 - \bar{x}_2 \), \( \hat{p}_1 - \hat{p}_2 \), median, etc. |
| Simulations Needed | At least 1,000; ideally 10,000+ |
| p-value Calculation | \( \frac{\text{# simulations as extreme as observed}}{N} \) |
| Decision Rule | Reject \( H_0 \) if \( p < \alpha \) |
Question 1 of 5
In a randomization test, the randomization distribution is created by:
Question 2 of 5
A researcher runs 10,000 randomization simulations and finds that 430 of the simulated statistics are as extreme or more extreme than the observed statistic. What is the p-value?
Question 3 of 5
Which of the following is a major advantage of a randomization test over a traditional \( t \)-test?
Question 4 of 5
A two-sided randomization test yields \( p = 0.12 \) at \( \alpha = 0.05 \). What is the correct conclusion?
Question 5 of 5
In a randomization test for two groups, you pool all data and randomly assign labels. Why does this procedure make sense under \( H_0 \)?