One-Sample Proportion Test Calculator
A one-sample proportion test asks whether an observed percentage differs significantly from a theoretical or expected proportion (p₀). Whether a survey result clears the 50% threshold, whether the defect rate on a production line exceeds the contractual limit, and whether the success rate of a treatment departs from the value reported in the literature are all decided with this test.
The test rests on the normal approximation to the binomial distribution, so it first checks that the expected numbers of successes and failures (n·p₀ and n·(1−p₀)) are at least 5. The calculator reports the z value with and without a Yates continuity correction, the corresponding p-values, the critical z, the Cohen h effect size, and — instead of a Wald interval — a Wilson score confidence interval for the proportion; it also shows the rejection region on a shaded normal curve.
One-Sample Proportion Test Formulas
Hypotheses: H₀: p = p₀ · H₁: p ≠ p₀ Sample proportion: p̂ = x / n Assumption: n·p₀ ≥ 5 and n·(1 − p₀) ≥ 5 Standard error: SE = √[ p₀(1 − p₀) / n ] Test statistic: z = (p̂ − p₀) / SE Continuity corr.: z_c = (|p̂ − p₀| − 1/(2n)) / SE, the sign is kept Wilson interval: [ p̂ + z²/(2n) ± z·√( p̂(1−p̂)/n + z²/(4n²) ) ] / (1 + z²/n) Effect size: h = 2·arcsin√p̂ − 2·arcsin√p₀
The thresholds for Cohen h are the same as for d: 0.20 small · 0.50 medium · 0.80 large. The standard error is computed with p₀ under H₀, while the confidence interval uses the observed p̂; this is why the test and the interval can occasionally disagree in borderline cases.
How to Calculate
- Enter the number of observations carrying the characteristic of interest (x) and the total sample size (n).
- Type the expected proportion you are comparing against as a percentage: 50 for 50%, 2.5 for 2.5%.
- Choose the hypothesis direction, the significance level (α), and the confidence level.
- Check the expected-count rows: if either n·p₀ or n·(1−p₀) falls below 5, use an exact binomial test instead of the normal approximation.
- Read the continuity-corrected z and p-value together with the decision line, and see where z falls in the rejection region on the shaded normal curve.
- Report the Wilson confidence interval and the Cohen h effect size; if the interval contains the expected proportion, the difference is not significant.
Worked Examples
Does the survey result clear the 50% threshold?
In a sample of 100 people, 62 gave a positive answer; p̂ = 0.62. The expected counts are 50 and 50, so the assumption is met and the standard error is 0.05. The uncorrected z = 2.400 (p = 0.016) and the continuity-corrected z = 2.300 (p = 0.021), and H₀ is rejected in both cases. The Wilson 95% confidence interval runs from 52.21% to 70.90% and does not contain 50%; Cohen h = 0.242 is a small effect.
z (continuity corrected): 2.3000 · p-value (corrected): p = 0.021 · z (uncorrected): 2.4000
Is the defect rate above the contractual limit?
18 defects were found in 300 products; p̂ = 0.06 against a contractual limit of 4%. The expected number of defects is 12 and the expected number of sound items is 288, so the assumption is met. In a right-tail test the uncorrected z = 1.768 (p = 0.039), while the continuity-corrected z = 1.621 (p = 0.053); with the corrected result H₀ cannot be rejected. The Wilson 95% interval runs from 3.83% to 9.28% and contains 4%.
z (continuity corrected): 1.6205 · p-value (corrected): p = 0.053 · z (uncorrected): 1.7678
A small sample that violates the assumption
3 successes were observed in 40 trials (p̂ = 0.075) against an expected proportion of 2%. Because the expected number of successes is only 0.80, the condition n·p₀ ≥ 5 is not met and a warning is issued. The uncorrected z = 2.485 (p = 0.013), while the continuity-corrected z = 1.920 (p = 0.055); the two results pointing to different decisions shows that the normal approximation is strained on this sample. The Wilson 95% interval runs from 2.58% to 19.86%.
z (continuity corrected): 1.9200 · p-value (corrected): p = 0.055 · z (uncorrected): 2.4846