Perform hypothesis tests for population proportions using the Z-test. Supports one-sample tests against a known proportion and two-sample tests comparing independent proportions. Compute z-statistics, p-values, confidence intervals, and draw statistical conclusions with visual feedback.
The proportion Z-test is a statistical procedure used to determine whether the proportion of successes in a population differs from a hypothesized value (one-sample) or whether two independent population proportions are significantly different (two-sample). It is based on the normal approximation to the binomial distribution and is widely used in fields such as public health, market research, political science, quality control, and A/B testing.
The test statistic follows a standard normal distribution under the null hypothesis, making it straightforward to compute p-values and confidence intervals. This calculator automates the entire process, providing instant results with clear interpretations.
For a one-sample test, the Z-statistic is:
z = (p̂ − p₀) / √(p₀(1−p₀) / n)
For a two-sample test:
z = (p̂₁ − p̂₂) / √(p̂(1−p̂)(1/n₁ + 1/n₂))
where p̂ = (x₁ + x₂) / (n₁ + n₂) is the pooled proportion.
Step 1: Define Hypotheses. State the null hypothesis (H₀) and alternative hypothesis (H₁). For a one-sample test, H₀: p = p₀ and H₁ can be p ≠ p₀, p > p₀, or p < p₀. For a two-sample test, H₀: p₁ = p₂ and H₁ can be p₁ ≠ p₂, p₁ > p₂, or p₁ < p₂.
Step 2: Choose Significance Level (α). Commonly set to 0.05, 0.01, or 0.10. This represents the probability of rejecting H₀ when it is true (Type I error).
Step 3: Compute the Test Statistic. Using the formulas above, compute the z-statistic. The standard error accounts for the variability of the sample proportion.
Step 4: Calculate the P-Value. The p-value is the probability of observing a test statistic as extreme as the one computed, assuming H₀ is true. A small p-value indicates strong evidence against H₀.
Step 5: Draw a Conclusion. If p-value ≤ α, reject H₀. Otherwise, fail to reject H₀. The calculator also provides a confidence interval for the population proportion(s) to aid interpretation.
When conditions are not met: If the expected number of successes or failures is below 10, the normal approximation may be inaccurate. In such cases, consider using an exact binomial test (e.g., Fisher's exact test for two samples) or a continuity correction. This calculator does not apply a continuity correction to maintain simplicity and standard practice, but you should be aware of its existence.
The z-statistic measures how many standard errors the sample proportion is from the hypothesized value (or from the other sample proportion). A large absolute z-value indicates strong evidence against the null hypothesis. As a rule of thumb, |z| > 1.96 is often considered significant at the 5% level for two-sided tests, but always rely on the p-value for exact inference.
The p-value quantifies the strength of evidence against H₀. A p-value less than α suggests that the observed difference is statistically significant and unlikely to have occurred by chance alone. Remember that the p-value is conditional on H₀; it does not measure the magnitude of the effect. For that, we report Cohen's h.
The confidence interval provides a range of plausible values for the true population proportion(s). For a one-sample test, it is centered at the sample proportion. For a two-sample test, it estimates the difference p₁ − p₂. Confidence intervals and p-values are complementary: the interval shows the range of plausible population values, while the p-value indicates the strength of evidence against the null. A 95% CI that excludes the null value corresponds to a significant result at α = 0.05.
Cohen's h is a measure of effect size for proportions. Values of 0.2, 0.5, and 0.8 correspond to small, medium, and large effects respectively. It helps assess the practical significance of the result, independent of sample size.
A political pollster surveys 500 registered voters and finds that 275 support a particular candidate. The pollster wants to test whether the candidate's support differs from 50%. Using a one-sample proportion Z-test with α = 0.05, the calculator computes a z-statistic of 2.24 and a two-sided p-value of 0.025. Since p-value < 0.05, the pollster rejects H₀ and concludes that the candidate's support is significantly different from 50%, with an estimated proportion of 55% (95% CI: 50.6% to 59.4%).
An online retailer tests two checkout page designs. Version A (n₁ = 1000) yields 120 conversions (12%), while Version B (n₂ = 1100) yields 88 conversions (8%). The retailer wants to know if Version A significantly outperforms Version B. Using a two-sample proportion Z-test with α = 0.05 and a one-sided (greater) alternative, the z-statistic is 3.04 with a p-value of 0.0012. The retailer rejects H₀ and concludes that Version A has a significantly higher conversion rate. The 95% confidence interval for the difference is 1.5% to 6.5%, and Cohen's h = 0.13 (small effect).
A pharmaceutical company conducts a phase III trial for a new drug. Among 320 patients receiving the drug, 210 show improvement (65.6%). The historical success rate for the standard treatment is 60%. The company tests whether the new drug has a higher success rate (α = 0.01). The one-sample Z-test yields z = 1.97 and a one-sided p-value of 0.024. Since p-value > 0.01, the company fails to reject H₀ and cannot claim superiority at the 1% significance level, though the trend is suggestive (95% CI: 60.3% to 70.9%).