To calculate the p-value for a two-sided randomization test for 1-sample proportion, Minitab calculates the distance between the proportion of the original sample and the hypothesized proportion. Then Minitab adds and subtracts the distance to the hypothesized proportion to calculate two reference values. The p-value is the proportion of resamples that are at least as extreme as the reference values.

In the following example, the proportion of the original sample is 0.4 and the hypothesized proportion is 0.5. Therefore, the two reference values are 0.4 and 0.6. The red bars indicate that 0.111 of the resamples are less than or equal to 0.4 and 0.099 of the resamples are greater than or equal to 0.6. The sum of these two proportions results in a p-value of 0.21.

However, if the hypothesized proportion is close to 0 or 1, it is possible for one of the reference values to be less than 0 or greater than 1. Consider the case when the mean of the original sample is 0.15 and the hypothesized proportion is 0.07. This makes one of the reference values -0.01, which is a value that is not possible for a binomial variable. Because no resample can have a proportion less than -0.01, Minitab performs a one-sided test instead.

### Randomization Test for 1-Sample Proportion

Minitab displays results for a one-sided test because the p-value for a
two-sided test cannot be calculated.