Z-Test Formula
The Z-test formula compares a sample mean to a population mean.
Learn when to use it, how to calculate the Z-statistic, and interpret p-values.
The Formula
The Z-test is a hypothesis test used to determine whether a sample mean is significantly different from a known or hypothesized population mean. It quantifies how many standard errors the sample mean is from the population mean, producing a Z-statistic that maps directly to a probability (p-value).
Variables
| Symbol | Meaning | Unit |
|---|---|---|
| Z | Z-statistic (test statistic) | dimensionless |
| x̄ | Sample mean | same as data |
| μ | Population mean (null hypothesis value) | same as data |
| σ | Population standard deviation (known) | same as data |
| n | Sample size | count |
| σ/√n | Standard error of the mean | same as data |
Critical Z-Values and Significance Levels
- α = 0.10 (90% confidence): Z_critical = ±1.645 (two-tailed)
- α = 0.05 (95% confidence): Z_critical = ±1.960 (two-tailed)
- α = 0.01 (99% confidence): Z_critical = ±2.576 (two-tailed)
- α = 0.001 (99.9% confidence): Z_critical = ±3.291 (two-tailed)
Example 1 — One-Sample Z-Test
A factory claims average bolt diameter is 10 mm (σ = 0.5 mm). A sample of 36 bolts has mean 10.2 mm. Is this significantly different at α = 0.05?
Z = (10.2 − 10) / (0.5 / √36) = 0.2 / (0.5 / 6) = 0.2 / 0.0833
Z = 2.40
|Z| = 2.40 > 1.96 → Reject H₀. The mean is significantly different at 95% confidence.
Example 2 — Interpreting a Z-Score
Population mean IQ = 100, σ = 15. A class of 25 students scores mean = 105. Test at α = 0.05.
Z = (105 − 100) / (15 / √25) = 5 / (15/5) = 5 / 3
Z = 1.67
|Z| = 1.67 < 1.96 → Fail to reject H₀. Not significant at α = 0.05 (but would be at α = 0.10).
When to Use the Z-Test vs T-Test
- Use Z-test when: Population standard deviation (σ) is known AND/OR sample size n ≥ 30
- Use t-test when: σ is unknown and sample size is small (n < 30)
- Two-sample Z-test: Comparing means of two independent large samples
- Proportion Z-test: Testing if a sample proportion differs from a population proportion (formula: Z = (p̂ − p₀) / √(p₀(1−p₀)/n))