molecalculator

Moles & Molar Mass

Proportion Z Test Calculator: Formula and Examples

Calculator No. 01-3576 · Updated · Formula and assumptions shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

For study and lab planning. The result follows from the numbers you enter and the formula shown. Check it against your method before you weigh, mix or dilute anything, follow the safety data sheet and your supervisor, and do not use it for clinical, dosing or medication work.

A proportion z test calculator tests whether a population proportion differs from a specified value, or whether two independent population proportions differ. Enter the observed counts and sample sizes, along with the hypothesized proportion or test direction, to get a z statistic and p-value for your data.

Formula

This calculator performs a one-sample, two-sided proportion z test. It compares the sample proportion with the null-hypothesis proportion:

z = (p̂ − p₀) / √[p₀(1 − p₀) / n]

  • x is the number of observed successes, a count.
  • n is the sample size, a count.
  • p̂ = x/n is the observed sample proportion, with no units.
  • p₀ is the proportion specified by the null hypothesis, from 0 to 1.
  • z is the test statistic, expressed in standard-error units.

The two-sided p-value is 2[1 − Φ(|z|)], where Φ is the cumulative distribution function of the standard normal distribution. A p-value is a probability under the null model, not the probability that the null hypothesis is true. The block uses a two-sided p-value; its tail selector is provided to make the intended alternative visible, but the displayed calculation remains two-sided.

Worked Example

With the default values, 56 of 100 observations are successes and the null proportion is 0.5. The calculator tests whether the population proportion differs from 0.5.

  1. Sample proportion: p̂ = 56 / 100 = 0.56.
  2. Null standard error: √[0.5 × (1 − 0.5) / 100] = √0.0025 = 0.05.
  3. Test statistic: z = (0.56 − 0.5) / 0.05 = 1.2.
  4. Two-sided p-value: 2[1 − Φ(1.2)] ≈ 0.2301.

The result is z = 1.2000 and p ≈ 0.2301. At a significance level of 0.05, this p-value does not provide sufficient evidence to reject the null hypothesis. That conclusion does not establish that the population proportion is exactly 0.5.

Assumptions

  • Each observation has one of two outcomes, such as success or failure.
  • Observations are independent, and the sample represents the population of interest.
  • The null proportion is between 0 and 1, and the sample size is adequate for the normal approximation. A common check is that both np₀ and n(1 − p₀) are at least 5; some guidance uses 10.
  • This is a one-sample test. It does not calculate a confidence interval or a two-sample comparison.

When to Use a Proportion Z Test

Use a one-proportion z test when the outcome is categorical with two possible categories and the question concerns one population proportion. For example, a quality team might ask whether the fraction of items meeting a stated standard differs from 50%. The test evaluates evidence about the population proportion using a sample; it is not a way to prove that a claim is true or false.

Write the hypotheses before looking at the result. For a two-sided test, they are H₀: p = p₀ and H₁: p ≠ p₀. For a one-sided test, the alternative is H₁: p > p₀ or H₁: p < p₀. Choose the direction based on the research question in advance, not after seeing which direction gives a smaller p-value.

How to Read the Result

The sign of z indicates direction: a positive value means the sample proportion is above p₀, and a negative value means it is below. The magnitude describes how many null-model standard errors separate the observed proportion from p₀. The p-value measures how unusual a result at least this extreme would be if the null hypothesis and model assumptions held.

Compare the p-value with a preselected significance level, often 0.05. If p is below that level, the result is statistically significant under the test; otherwise, the evidence is insufficient to reject the null. Statistical significance does not measure practical importance. Report the observed proportion and, where appropriate, an interval estimate as well, so readers can judge the size and uncertainty of the effect.

Common Problems and Alternatives

  • Using percentages instead of proportions: Enter 0.50 for 50%, not 50. The success count must be between 0 and the sample size.
  • Ignoring the approximation: When the expected success or failure count under H₀ is small, the z approximation may be unreliable. For a small sample or a proportion near 0 or 1, consider an exact binomial test.
  • Counting dependent observations as independent: Repeated measurements on the same units, clustered samples, or paired outcomes may need a different method.
  • Confusing one-sample and two-sample tests: Comparing two groups requires both groups’ success counts and sample sizes. A pooled two-proportion z test uses a pooled estimate under the null; this calculator does not perform that test.
  • Rounding too early: Keep the original counts and calculate with full precision; round only the displayed z statistic and p-value.

A continuity correction can improve the normal approximation in some discrete-data settings, but it changes the calculation and is not included here. If the design has weights, clustering, or other complex sampling features, use a method that accounts for the design rather than treating the observations as a simple random sample.

Frequently Asked Questions

What is a proportion z test calculator?
A proportion z test calculator uses a sample success count, sample size, and hypothesized population proportion to calculate a z statistic and an approximate p-value for a one-sample test.

What is the difference between a z test and a binomial test?
The z test approximates the binomial sampling distribution with a normal distribution. An exact binomial test calculates probabilities from the binomial distribution directly and is often preferable when expected counts are small.

Can I use this calculator to compare two proportions?
No. It tests one sample proportion against a specified null value. A two-proportion test needs the success count and sample size for each independent group.

What does a p-value of 0.05 mean?
It means that, assuming the null hypothesis and model are correct, the probability of a result at least as extreme as the observed one is 5% for the specified test. It does not mean there is a 95% chance the alternative is true.

Does a significant result prove the proportion is different?
No. It indicates that the data would be relatively unusual under the null model at the chosen threshold. Sampling bias, dependence, and practical importance still need consideration.

Related

Formula used
in x | Successes in sample | count | 56 | 0
in n | Sample size | count | 100 | 1
in p0 | Null proportion | proportion | 0.5 | 0
sel tail | Alternative hypothesis | Two-sided=1, Greater than=2, Less than=3
out z | Proportion z statistic | - | (x / n - p0) / sqrt(p0 * (1 - p0) / n) | 4
out p | Approximate p-value | - | 2 * (1 - 0.5 * (1 + erf(abs(z) / sqrt(2)))) | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.

More in this section

The whole Moles & Molar Mass section →