01 / 21

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.

College Statistics

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?

✓ Fewer Assumptions
No need for normality, equal variances, or large sample sizes.
✓ Intuitive Logic
The p-value comes from directly simulating "what if chance alone explains this?"
✓ Flexible Statistic
Works with means, medians, proportions, or any summary you choose.

Key Vocabulary

1
Null Hypothesis \( H_0 \): The claim that there is no real effect or difference: any pattern in the data is due to chance alone.
2
Observed Statistic: The value (e.g., \( \bar{x}_1 - \bar{x}_2 \)) you actually calculated from your collected data.
3
Randomization Distribution: The collection of statistics generated by many random reassignments of group labels.
4
p-value: The proportion of randomization statistics that are as extreme or more extreme than the observed statistic.

The Core Logic

Observed Data
Assume
\( H_0 \) is true
Shuffle Labels Compute Statistic Repeat 1000+ Randomization Distribution Compare & find p-value

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

1
State hypotheses. Write \( H_0 \) (no difference) and \( H_a \) (there is a difference).
2
Compute the observed statistic. For example, \( d_{\text{obs}} = \bar{x}_1 - \bar{x}_2 \).
3
Simulate under \( H_0 \). Pool all data, randomly reassign group labels, and compute the statistic. Repeat many times (e.g., 10,000).
4
Build the randomization distribution from all simulated statistics.
5
Find the p-value: the proportion of simulated statistics as extreme or more extreme than \( d_{\text{obs}} \).
6
Make a decision. If \( p < \alpha \), reject \( H_0 \). Otherwise, fail to reject.

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:

Treatment
\( \bar{x}_T = 7.8 \) hours
Control
\( \bar{x}_C = 6.9 \) hours

Simulating Under \( H_0 \)

\( d_{\text{obs}} = 0.9 \)
Simulated Difference in Means -1.0 -0.5 0 0.5 1.0 p-value region

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.

Men (\( n = 15 \))
\( \bar{x}_M = \$72{,}400 \)
Women (\( n = 12 \))
\( \bar{x}_W = \$67{,}100 \)

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| \).

+5300 -5300 Simulated Difference ($) 0

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.

Drug
\( \hat{p}_D = \frac{18}{30} = 0.60 \)
Placebo
\( \hat{p}_P = \frac{11}{30} = 0.367 \)

Interpreting the p-value

1
Small p-value (e.g., \( p < 0.05 \)): The observed result is unlikely under \( H_0 \). We have evidence against the null hypothesis.
2
Large p-value (e.g., \( p > 0.05 \)): The observed result is plausible under \( H_0 \). We lack evidence to reject the null.
3
The p-value is NOT the probability that \( H_0 \) is true. It's the probability of seeing data this extreme if \( H_0 \) were true.

Common Mistakes

✕ Confusing one-sided and two-sided
A two-sided test counts extremes in both tails. Using the wrong one doubles or halves the p-value incorrectly.
✕ Too few simulations
Using only 100 shuffles gives an unreliable p-value. Use at least 1,000 (ideally 10,000+) for stable results.
✕ Misinterpreting the p-value
The p-value is not the probability that \( H_0 \) is true. It measures how surprising the data are under \( H_0 \).

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 \)?