Hypothesis tests

Online one-proportion hypothesis test calculator

Check whether an observed proportion is compatible with a reference value.

Calculator

Online calculator that computes z, the p-value and the test decision for a proportion.

Result pending…

Explanation

The one-proportion test applies when each observation has two possible outcomes (success/failure) and you want to assess whether the population proportion is \(p_0\). It is a common test in campaign validation, production quality, clinical trials and opinion studies.

The method relies on the normal approximation of the sample proportion under \(H_0\), so the quality of the approximation improves with adequate sample sizes.

Hypotheses and test statistic

\(H_0: p = p_0\)

\( z = \frac{\hat{p} - p_0}{\sqrt{p_0(1-p_0)/n}} \)

  • \(\hat{p}\): observed sample proportion (successes / n).
  • \(p_0\): proportion stated in the null hypothesis.
  • \(n\): sample size.

Quick test

Under \(H_0\), the variability of \(\hat{p}\) is given by \(p_0(1-p_0)/n\). That is why the denominator uses \(p_0\): we are evaluating compatibility with the specific null hypothesis.

The normal approximation is reasonable when \(n p_0\) and \(n(1-p_0)\) are large enough (rule of thumb: at least 5 or 10).

Worked example

According to previous studies, 65% of a company's customers are satisfied with the service (\(p_0 = 0.65\)). After an improvement campaign, \(n = 120\) customers are surveyed and 85 report being satisfied, that is, \(\hat{p} = 85/120 \approx 0.708\). Has the proportion changed significantly? Test with \(\alpha = 0.05\), two-tailed.

The hypotheses are \(H_0\colon p = 0.65\) versus \(H_1\colon p \neq 0.65\). The standard error under the null hypothesis is:

\( SE = \sqrt{\dfrac{p_0(1-p_0)}{n}} = \sqrt{\dfrac{0.65 \cdot 0.35}{120}} = \sqrt{0.001896} \approx 0.04354 \)

The z statistic is:

\( z = \dfrac{\hat{p} - p_0}{SE} = \dfrac{0.708 - 0.65}{0.04354} \approx 1.33 \)

For a two-tailed test with \(\alpha = 0.05\), the critical value is \(z_{0.025} \approx 1.96\). Since \(|z| = 1.33 < 1.96\), the rejection region is not reached. The two-tailed p-value is \(p \approx 0.183 > 0.05\).

Conclusion: \(H_0\) is not rejected. With these data, the difference between the observed proportion (70.8%) and the reference proportion (65%) is not statistically significant at the 5% level. The improvement could be due to sampling chance.

How to interpret the result

Rejecting \(H_0\) (p-value < α) means that the sample proportion \(\hat{p}\) deviates from \(p_0\) more than expected by chance. It is concluded that there is statistical evidence that the population proportion differs from \(p_0\) (or is greater/smaller, if the test is one-tailed). However, significance does not equal importance: a 1 percentage point difference can be highly significant with a large \(n\) even though it is irrelevant in practice. Always accompany the result with the confidence interval for \(p\) and an assessment of the size of the change in the context of the problem.

Not rejecting \(H_0\) (p-value ≥ α) does not prove that \(p = p_0\); it only indicates that the data are compatible with that value at the chosen significance level. If the sample is small, the power may be insufficient to detect real deviations. A wide confidence interval that includes values far from \(p_0\) is a sign that the study does not allow definitive conclusions.

The z statistic shown by the tool measures how many standard errors \(\hat{p}\) is away from \(p_0\). In the chart, the green zone is the non-rejection region, the red zones are the critical regions and the amber line represents the observed statistic. Values of \(|z|\) greater than the critical value (e.g., 1.96 for a two-tailed α = 0.05) lead to rejecting \(H_0\). Always verify that the validity conditions of the normal approximation are met: \(np_0 \geq 5\) and \(n(1-p_0) \geq 5\).

Frequently asked questions

  • When is the normal approximation valid? When the sample size lets you expect enough successes and failures under \(H_0\).
  • Can I use a percentage instead of a proportion? Yes, but convert it to a 0–1 scale for the calculation.
  • Which tail should I choose? Two-tailed if you're looking for any difference; one-tailed if you're only interested in an increase or a decrease.
  • Does significant mean important? Not always; also assess the size of the change in terms of business or real-world impact.
  • Does this distinguish between sample and population deviation? Not in the same way as with means. For proportions, the standard error is built with \(p_0\) (or with the pooled proportion for two proportions), not with a \(\sigma\) supplied by the user.