Sub topic 15
How Much Data Is Enough: Sample Size and Power
What sample size and power mean
Assume you already know the DMAIC cycle, basic descriptive statistics, and the difference between a sample and a population. This chapter focuses on planning data collection before running a hypothesis test.
In the Analyze phase, sample size answers: “How many observations do we need?” Power answers: “How likely is our test to detect a real effect of the size we care about?”
A test can produce a large p-value because there is no meaningful difference. It can also produce a large p-value because the sample is too small. Power analysis helps distinguish these situations during project planning.
The four planning inputs
Sample size planning usually uses four inputs:
- Effect size: The smallest change that would matter to the process. For a difference between means, this may be a change of 2 minutes or a standardized difference such as Cohen’s d.
- Significance level, alpha: The chosen risk of a Type I error. A common value is 0.05.
- Power: The probability of detecting the planned effect if it is real. A common target is 0.80 or 80%.
- Test design: The test affects the calculation. A paired test, two-sample test, proportion test, and ANOVA need different methods.
A Type II error occurs when the test fails to detect a real effect. Power is the complement of the Type II error rate:
\[ \text{Power} = 1 - \beta \]
For example, 80% power means that repeated studies would detect the planned effect about 80% of the time, assuming the planning assumptions are correct.
| Planning choice | Common value | What changing it does |
|---|---|---|
| Alpha | 0.05 | Lower alpha usually requires more data |
| Power | 0.80 | Higher power requires more data |
| Standardized effect size | 0.50 | Smaller effects require more data |
| Design | Two independent groups | Determines the calculation method |
A worked calculation
Suppose a team compares cycle time for two independent process conditions. It wants to detect a medium standardized difference of 0.5, using alpha 0.05 and 80% power. The following calculation estimates the required observations per group.
from statsmodels.stats.power import TTestIndPower
analysis = TTestIndPower()
n_per_group = analysis.solve_power(
effect_size=0.5,
alpha=0.05,
power=0.80,
alternative="two-sided",
)
print(f"Required sample size per group: {n_per_group:.1f}")
print(f"Round up to: {int(n_per_group + 0.9999)} observations per group")The result is about 63.8, so the team should plan for 64 observations per group. The calculation is not a guarantee. It depends on the expected variation, effect size, test assumptions, and data quality.
Statistical and practical significance
A very large sample can make a tiny difference statistically significant. That difference may still be too small to improve cost, quality, or customer experience.
Before collecting data, document the practical threshold: the smallest change worth acting on. Then use that threshold as the planned effect. After the test, report the estimated difference and a confidence interval alongside the p-value.
Exercise
A team plans a two-sample test with 80% power to detect a 5-minute improvement. What should it do if a later calculation shows that 5 minutes requires more data than the project can collect?
Show answer
Reconsider the design, timeline, or measurement plan. It should not quietly lower the target effect or treat an underpowered result as proof that no improvement exists.