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α\alpha0.05Team, from the cost of a false alarm
Power1−β1 - \beta0.80 or 0.90Team, from the cost of missing a real effect
Difference to detectδ\deltaThe practical thresholdProcess owner or customer
Process standard deviationσ\sigmaFrom 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α/2z_{\alpha/2} at α=0.05\alpha = 0.05 two-sided1.960
zαz_{\alpha} at α=0.05\alpha = 0.05 one-sided1.645
zβz_{\beta} at 80% power0.842
zβz_{\beta} at 90% power1.282

Comparing two means

For a two-sided test of H0:μ1=μ2H_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 α=0.05\alpha = 0.05 two-sided and 80% power, (1.960+0.842)2=7.85(1.960 + 0.842)^2 = 7.85, so a useful shortcut is

n≈15.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 σ=3.0\sigma = 3.0 units. At α=0.05\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.8→63 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(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 zz values, which assumes σ\sigma is known. When σ\sigma is estimated from the sample, the tt distribution applies and the requirement is slightly larger. The standard practical fix is to compute with zz, then add two to four observations per group, or iterate using tt values at the resulting degrees of freedom. For nn above about 30 per group the difference is negligible.

Comparing two proportions

n=(zα/2+zβ)2[p1(1−p1)+p2(1−p2)](p1−p2)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 α=0.05\alpha = 0.05 two-sided and 80% power:

  • p1(1−p1)=0.05×0.95=0.0475p_1(1-p_1) = 0.05 \times 0.95 = 0.0475
  • p2(1−p2)=0.03×0.97=0.0291p_2(1-p_2) = 0.03 \times 0.97 = 0.0291
  • Sum =0.0766= 0.0766; (p1−p2)2=(0.02)2=0.0004(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(1−p0)+zβp1(1−p1))2(p1−p0)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
δ\delta1x
δ/2\delta / 24x
δ/4\delta / 416x

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=12n = 12 per group and σ=3.0\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 nn by the expected loss fraction
Unequal group sizes with ratio kkn1=(1+1/k)2×nequaln_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.05n/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 nn 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

63

B

32

C

16

D

126

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

About 60 per group; attribute data is efficient for small shifts

B

About 1,500 per group; attribute data requires far larger samples than continuous data for the same practical sensitivity

C

About 300 per group; sample size depends only on alpha and power

D

The sample size cannot be computed without the process standard deviation

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

That no difference exists between the groups

B

That the alpha level should be raised to 0.10 and the test repeated on the same data

C

That the study could detect only a shift of about 3.4 units and is therefore inconclusive for a 1.5-unit difference

D

That the process must be non-normal

Sections you finish are checked off in the contents.