Perform a complete hypothesis test for a single population proportion. Compute the z‑statistic, p‑value, and confidence interval, and visualize the sampling distribution under the null hypothesis. Supports two‑tailed, left‑tailed, and right‑tailed alternatives with adjustable significance level. Ideal for introductory statistics, A/B testing, clinical trials, and survey analysis.
The one‑proportion Z‑test (also called the one‑sample test for a proportion) is a fundamental statistical procedure used to determine whether the proportion of successes in a single population differs from a hypothesized value. It is the categorical‐data counterpart to the one‑sample t‑test and is widely applied in fields such as public health, political science, market research, quality control, and genetics.
The test relies on the Central Limit Theorem, which states that the sampling distribution of the sample proportion p̂ approximates a normal distribution when the sample size is sufficiently large. The test statistic measures how many standard errors the observed proportion lies from the hypothesized proportion, and the p‑value quantifies the strength of evidence against the null hypothesis.
H₀: p = p₀ vs Hₐ: p ≠ p₀ (or < or >)
z = (p̂ − p₀) / √(p₀(1−p₀) / n) where p̂ = x / n
Under H₀, z ~ N(0, 1) approximately, provided n·p₀ ≥ 10 and n·(1−p₀) ≥ 10.
A pharmaceutical company develops a new drug expected to cure a certain disease in 75% of patients. In a clinical trial with 120 patients, 96 patients are cured (80%). The company wants to test whether the drug's cure rate is significantly higher than the historical standard of 70% (not 75%). The hypotheses are:
H₀: p = 0.70 vs Hₐ: p > 0.70.
With x = 96, n = 120, p₀ = 0.70, we compute p̂ = 0.80, SE = √(0.70·0.30/120) ≈ 0.0418, z ≈ (0.80−0.70)/0.0418 ≈ 2.39. The right‑tailed p‑value ≈ 0.0084, which is less than α = 0.05, so we reject H₀ and conclude that the drug's cure rate is significantly higher than 70%. This result supports the drug's efficacy and justifies further investigation.
Alongside the hypothesis test, this calculator provides a (1−α)·100% confidence interval for the true population proportion p, constructed using the Wilson score interval (also called the Wilson interval). The Wilson interval is preferred over the traditional Wald interval because it has better coverage properties, especially for proportions near 0 or 1 and for moderate sample sizes.
Wilson CI: (p̂ + z²/(2n) ± z·√(p̂(1−p̂)/n + z²/(4n²))) / (1 + z²/n)
The Wilson interval is used by many statistical software packages and is recommended in introductory statistics courses. It is also the default method for confidence intervals for proportions in the binom.test function in R.
Compare the conversion rate of a new webpage design against the historical conversion rate. Use a one‑proportion Z‑test to determine if the new design significantly improves conversions.
Test whether a candidate's support exceeds 50% of the electorate. Pollsters use this test to project election outcomes and assess margin of error.
Manufacturers test whether the defect rate of a production process exceeds an acceptable threshold. A left‑tailed test can verify that the defect rate is below a specified limit.
Test whether the proportion of individuals carrying a specific allele matches the expected Hardy‑Weinberg proportion in a population.
The Z‑test uses a normal approximation to the binomial distribution. When the sample size is small or the hypothesized proportion is extreme (near 0 or 1), the approximation can be poor. In such cases, the exact binomial test (also called the Clopper‑Pearson test) is preferred. This calculator automatically checks the success‑failure condition and warns you if the approximation may be unreliable, guiding you toward using an exact method or collecting more data.
For reference, the exact binomial test computes the p‑value directly from the binomial distribution:
P(X ≥ x) = Σk=xn C(n,k) p₀k (1−p₀)n−k (right‑tailed), with analogous expressions for left‑tailed and two‑tailed tests.