Simulation-Based Hypothesis Test for a Difference in Proportions – Learn It 1

  • Complete a randomization test involving a difference in proportions

Randomization Test and Permutation Test

In this section, let’s revisit hypothesis testing for a difference in proportions, but rather than calculating a P-value using a traditional two-sample hypothesis test, we will use a tool to simulate a null distribution of sample differences in proportions. Then, we can compare the observed difference in proportions to this distribution to obtain an approximate P-value. This procedure is called a randomization test.

randomization test

Randomization procedures use resampling techniques to construct a sampling distribution that can be used to make inferences about the population.

Randomization is constructed given that the null hypothesis is true, and its distribution will be centered on the null hypothesis value.

Technically, this test procedure is only called a randomization test when the data arise from a randomized experiment, since the simulation mimics the random assignment in the study.

When data arise from an observational study, the procedure is called a permutation test.

Let’s look at an example!

Peanut Allergy

From 2005 to 2015, the proportion of children allergic to peanuts doubled in Western countries. However, the allergy is not very common in some other countries where peanut protein is an important part of people’s diets. The Learning Early about Peanut Allergy (LEAP) randomized trial, reported by Du Toit and others in The New England Journal of Medicine in February 2015, identified over 500 children ages four to 10 months who showed some sensitivity to peanut protein.[1] They randomly assigned them to two groups:

  • Peanut avoiders: Parents were told not to give their kids any foods that contained peanuts
  • Peanut eaters: Parents were given snacks containing peanut protein and were told to feed them to their children several times per week (target dose was at least six grams of peanut protein per week)

The researchers tracked the children for five years and then recorded whether the children had developed peanut allergies by age five. They hoped to show that feeding children peanut protein at an early age helps prevent peanut allergies.


  1. Du Toit, G., Roberts, G., Sayre, P. H., Bahnson, H. T., Radulovic, S., Santos, A. F., Brough, H. A., Phippard, D., Basting, M., Feeney, M., Turcanu, V., Sever, M. L., Lorenzo, M. G., Plaut, M., & Lack, G. (2015, February 26). Randomized trial of peanut consumption in infants at risk for peanut allergy. The New England Journal of Medicine, 372(9), 803–813. https://www.nejm.org/doi/full/10.1056/NEJMoa1414850