Comparing Two Groups Using Simulation
Comparing two groups by randomization
A randomization or permutation test asks what differences would be typical if group labels carried no association with the measured outcome.
Choose a statistic before inspecting the simulated results, calculate it on the observed groups, then repeatedly shuffle labels while holding the observed outcome values and group sizes fixed. Recalculate the same statistic for each shuffle.
The simulated null distribution is the distribution of the statistic under exchangeable labels. A two-sided p-value is the proportion of simulated statistics at least as far from the null value as the observed statistic, using a declared extremeness rule.
It measures compatibility with the null model, not the probability that the null is true and not the size or importance of an effect.
Random assignment supports a causal comparison if the design was implemented well. An observational comparison can show an association, but relabeling does not remove confounding, selection bias, or measurement bias.
A two-sided permutation analysis ran 2,000 label shuffles. In 46 shuffles, the absolute difference in means was at least the observed absolute difference. What is the empirical p-value?
An observational study finds a small permutation p-value for a difference between students who chose two study apps. What conclusion is justified?