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.
The four inputs
Every sample size calculation needs the same four quantities, and three of them are business decisions rather than statistical ones.
| Input | Symbol | Typical value | Who decides |
|---|---|---|---|
| Significance level | 0.05 | Team, from the cost of a false alarm | |
| Power | 0.80 or 0.90 | Team, from the cost of missing a real effect | |
| Difference to detect | The practical threshold | Process owner or customer | |
| Process standard deviation | From baseline data or a pilot | Measured |
The most common failure is treating 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:
| Quantity | Value |
|---|---|
| at two-sided | 1.960 |
| at one-sided | 1.645 |
| at 80% power | 0.842 |
| at 90% power | 1.282 |
Comparing two means
For a two-sided test of with equal group sizes:
At two-sided and 80% power, , so a useful shortcut is
Worked example. A team wants to detect a 1.5-unit shift in mean cycle time. Baseline data gives units. At and 80% power:
Always round up. Raising power to 90% changes the multiplier to 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
Exactly half the two-sample requirement, because only one mean is being estimated.
When sigma is unknown and n is small
These formulas use values, which assumes is known. When is estimated from the sample, the distribution applies and the requirement is slightly larger. The standard practical fix is to compute with , then add two to four observations per group, or iterate using values at the resulting degrees of freedom. For above about 30 per group the difference is negligible.
Comparing two proportions
Worked example. Current defect rate is 5%, and the team wants to detect a reduction to 3%. At two-sided and 80% power:
- Sum ;
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
The inverse-square relationship
Because appears squared in the denominator, sensitivity is expensive:
| Detectable difference | Relative sample size |
|---|---|
| 1x | |
| 4x | |
| 16x |
The same relationship works in your favour on the other side: halving 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 and shrinks every subsequent sample size requirement.
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:
With per group and :
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
| Situation | Adjustment |
|---|---|
| Expected dropout, invalid records, or destructive test loss | Inflate by the expected loss fraction |
| Unequal group sizes with ratio | |
| Multiple comparisons | Use a Bonferroni-adjusted in the calculation |
| Finite population | Apply the finite population correction when |
| Clustered or subgrouped data | Inflate by the design effect; observations within a cluster are not independent |
Sizing checklist
- Is the smallest practically important difference, agreed with the process owner?
- Is from real baseline data on this process, not a textbook value?
- Does include measurement variation, and would improving the gauge be cheaper than more data?
- Are and power chosen from the relative cost of the two errors?
- Has been rounded up and inflated for expected loss?
- Is collecting that many observations feasible in the project timeline? If not, renegotiate or power before collecting, not after.
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?
63
32
16
126
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?
About 60 per group; attribute data is efficient for small shifts
About 1,500 per group; attribute data requires far larger samples than continuous data for the same practical sensitivity
About 300 per group; sample size depends only on alpha and power
The sample size cannot be computed without the process standard deviation
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?
That no difference exists between the groups
That the alpha level should be raised to 0.10 and the test repeated on the same data
That the study could detect only a shift of about 3.4 units and is therefore inconclusive for a 1.5-unit difference
That the process must be non-normal
Sections you finish are checked off in the contents.