Test a sample proportion against a claimed value, or a sample mean when the population standard deviation is known, with the z statistic, p-value and 95% confidence interval.
z = (p̂ − p₀) ÷ √(p₀(1 − p₀) ÷ n)
Compares one sample’s proportion with a fixed value. To compare two groups, use the A/B test calculator.
A z-test checks whether a sample result differs from a claimed value by more than chance would explain, using the normal distribution. It applies when the standard error is known, which is the case for proportions and for means when the population SD is known.
The most common use is for proportions: does 56% preferring a new design really beat 50%? Does a 3% defect rate exceed the 2% target? Polls, quality checks and conversion rates all fit.
For means, the population SD is rarely known exactly, so the t-test is usually the right tool. Standardised tests with published norms, like IQ with SD 15, are the classic exception.
As given in OpenStax Introductory Statistics, chapter 9. See Sources.
The test uses p₀ in the standard error; the interval uses p̂, which is why the two can occasionally disagree right at the boundary.
Very strong evidence of a genuine preference. The 95% interval, 53% to 59%, gives the plausible size of it.
The same 56% preference, tested against 50% with different numbers of people.
| People | z | p (two-tailed) |
|---|---|---|
| 50 | 0.85 | 0.3961 |
| 100 | 1.2 | 0.2301 |
| 250 | 1.9 | 0.0578 |
| 500 | 2.68 | 0.0073 |
| 1,000 | 3.79 | 1.48e-4 |
For proportions, and for means only when the population standard deviation is genuinely known. Otherwise use a t-test.
For proportions, np₀ and n(1 − p₀) should both be at least about 10. For means with known σ, normal data or n of about 30 or more.
For one proportion, yes: the one-proportion z-test is the standard large-sample test.
The test asks how surprising p̂ would be if p₀ were true, so it uses p₀’s spread. The interval estimates the true proportion, so it uses p̂.
Yes, any p₀ strictly between 0 and 1, such as a 2% defect target.
The sample result is below the hypothesised value.
Calculate z with the formula, then =2*(1-NORM.S.DIST(ABS(z),TRUE)) for a two-tailed p. Excel’s Z.TEST function is for means with raw data.
Use the binomial distribution: the chance of x or more successes out of n when the true rate is p₀.