7.6 Sample Size for Hypothesis Tests

Key Takeaways

  • Sample size depends on four quantities: alpha, power, the difference to be detected, and the process standard deviation.
  • For a two-sided two-sample comparison of means, n per group is approximately 2 times the square of (z alpha over 2 plus z beta) times sigma squared divided by delta squared.
  • Required sample size scales with the inverse square of the effect size, so halving the detectable difference quadruples the sample.
  • Attribute data requires far larger samples than continuous data for the same practical sensitivity.
  • Power is one minus beta, the probability of correctly detecting a real difference; 80% or 90% are the conventional targets.
Last updated: August 2026

The four inputs

Every sample size calculation needs the same four quantities, and three of them are business decisions rather than statistical ones.

InputSymbolTypical valueWho decides
Significance level$\alpha$0.05Team, from the cost of a false alarm
Power$1 - \beta$0.80 or 0.90Team, from the cost of missing a real effect
Difference to detect$\delta$The practical thresholdProcess owner or customer
Process standard deviation$\sigma$From baseline data or a pilotMeasured

The most common failure is treating $\delta$ as a statistical parameter. It is not: it is the smallest difference worth detecting, and it comes from the economics of the process. If a 2% yield improvement is the smallest change that would justify implementation, size the study to detect 2%.

Standard normal values needed:

QuantityValue
$z_{\alpha/2}$ at $\alpha = 0.05$ two-sided1.960
$z_{\alpha}$ at $\alpha = 0.05$ one-sided1.645
$z_{\beta}$ at 80% power0.842
$z_{\beta}$ at 90% power1.282

Comparing two means

For a two-sided test of $H_0: \mu_1 = \mu_2$ with equal group sizes:

n=2(zα/2+zβ)2σ2δ2per groupn = \frac{2(z_{\alpha/2} + z_{\beta})^2 \sigma^2}{\delta^2} \quad \text{per group}

At $\alpha = 0.05$ two-sided and 80% power, $(1.960 + 0.842)^2 = 7.85$, so a useful shortcut is

n15.7σ2δ2per groupn \approx \frac{15.7\,\sigma^2}{\delta^2} \quad \text{per group}

Worked example. A team wants to detect a 1.5-unit shift in mean cycle time. Baseline data gives $\sigma = 3.0$ units. At $\alpha = 0.05$ and 80% power:

n=2(1.960+0.842)2(3.0)2(1.5)2=2×7.851×92.25=141.32.25=62.863 per groupn = \frac{2(1.960 + 0.842)^2 (3.0)^2}{(1.5)^2} = \frac{2 \times 7.851 \times 9}{2.25} = \frac{141.3}{2.25} = 62.8 \rightarrow 63 \text{ per group}

Always round up. Raising power to 90% changes the multiplier to $(1.960 + 1.282)^2 = 10.51$ and the requirement to 85 per group -- a 35% increase in data for a 10 percentage point gain in power.

One sample against a target

n=(zα/2+zβ)2σ2δ2n = \frac{(z_{\alpha/2} + z_{\beta})^2 \sigma^2}{\delta^2}

Exactly half the two-sample requirement, because only one mean is being estimated.

When sigma is unknown and n is small

These formulas use $z$ values, which assumes $\sigma$ is known. When $\sigma$ is estimated from the sample, the $t$ distribution applies and the requirement is slightly larger. The standard practical fix is to compute with $z$, then add two to four observations per group, or iterate using $t$ values at the resulting degrees of freedom. For $n$ above about 30 per group the difference is negligible.

Comparing two proportions

n=(zα/2+zβ)2[p1(1p1)+p2(1p2)](p1p2)2per groupn = \frac{(z_{\alpha/2} + z_{\beta})^2 \left[p_1(1-p_1) + p_2(1-p_2)\right]}{(p_1 - p_2)^2} \quad \text{per group}

Worked example. Current defect rate is 5%, and the team wants to detect a reduction to 3%. At $\alpha = 0.05$ two-sided and 80% power:

  • $p_1(1-p_1) = 0.05 \times 0.95 = 0.0475$
  • $p_2(1-p_2) = 0.03 \times 0.97 = 0.0291$
  • Sum $= 0.0766$; $(p_1 - p_2)^2 = (0.02)^2 = 0.0004$

n=7.851×0.07660.0004=0.60140.0004=1,503 per groupn = \frac{7.851 \times 0.0766}{0.0004} = \frac{0.6014}{0.0004} = 1{,}503 \text{ per group}

Just over 1,500 units per group -- 3,000 units in total -- to detect a 2 percentage point change. This single result explains why continuous data is preferred wherever it is available: a comparable continuous study typically needs a few dozen observations per group.

One sample against a target proportion

n=(zα/2p0(1p0)+zβp1(1p1))2(p1p0)2n = \frac{(z_{\alpha/2}\sqrt{p_0(1-p_0)} + z_{\beta}\sqrt{p_1(1-p_1)})^2}{(p_1 - p_0)^2}

The inverse-square relationship

Because $\delta$ appears squared in the denominator, sensitivity is expensive:

Detectable differenceRelative sample size
$\delta$1x
$\delta / 2$4x
$\delta / 4$16x

The same relationship works in your favour on the other side: halving $\sigma$ quarters the required sample. Improving the measurement system is therefore often cheaper than collecting more data. If gage R&R contributes a large share of the observed variance, fixing the gauge reduces $\sigma$ and shrinks every subsequent sample size requirement.

σobserved2=σprocess2+σmeasurement2\sigma^2_{observed} = \sigma^2_{process} + \sigma^2_{measurement}

Power analysis after the fact

If a study has already been run and returned a non-significant result, compute the difference it was actually able to detect:

δdetectable=(zα/2+zβ)σ2n\delta_{detectable} = (z_{\alpha/2} + z_{\beta})\,\sigma\sqrt{\frac{2}{n}}

With $n = 12$ per group and $\sigma = 3.0$:

δ=2.802×3.0×2/12=2.802×3.0×0.408=3.43\delta = 2.802 \times 3.0 \times \sqrt{2/12} = 2.802 \times 3.0 \times 0.408 = 3.43

The study could only detect a shift of 3.4 units. Reporting "no significant difference" when the practically important difference was 1.5 units is misleading; the honest statement is that the study was inconclusive.

Practical adjustments

SituationAdjustment
Expected dropout, invalid records, or destructive test lossInflate $n$ by the expected loss fraction
Unequal group sizes with ratio $k$$n_1 = \frac{(1 + 1/k)}{2} \times n_{equal}$
Multiple comparisonsUse a Bonferroni-adjusted $\alpha$ in the calculation
Finite populationApply the finite population correction when $n/N > 0.05$
Clustered or subgrouped dataInflate by the design effect; observations within a cluster are not independent

Sizing checklist

  1. Is $\delta$ the smallest practically important difference, agreed with the process owner?
  2. Is $\sigma$ from real baseline data on this process, not a textbook value?
  3. Does $\sigma$ include measurement variation, and would improving the gauge be cheaper than more data?
  4. Are $\alpha$ and power chosen from the relative cost of the two errors?
  5. Has $n$ been rounded up and inflated for expected loss?
  6. Is collecting that many observations feasible in the project timeline? If not, renegotiate $\delta$ or power before collecting, not after.
Test Your Knowledge

A team wants to detect a 1.5-unit shift in a mean with sigma = 3.0, alpha = 0.05 two-sided, and 80% power. Approximately how many observations per group are required?

A
B
C
D
Test Your Knowledge

A team must detect a reduction in defect rate from 5% to 3% at alpha = 0.05 and 80% power. Roughly how many units per group are needed, and what does the result illustrate?

A
B
C
D
Test Your Knowledge

A completed study with 12 observations per group and sigma = 3.0 reports no significant difference. The practically important difference was 1.5 units. What should be reported?

A
B
C
D