Sub topic 8
How Many Observations: Sample Size for a Proportion
Assume you know the DMAIC phases, can distinguish a sample from a population, and understand a proportion as a fraction or percentage. This chapter focuses on planning the number of observations needed to estimate a defect rate or another pass/fail measure.
Why sample size matters
A small sample can give an unstable estimate. For example, observing two defective invoices in a sample of 20 gives a defect rate of 10%. A different sample of 20 might contain four defective invoices and give a rate of 20%.
A larger sample usually gives a more precise estimate, but it requires more time and effort. Sample size planning balances precision, confidence, and available resources.
For a proportion, the usual planning formula is:
\[ n = \frac{z^2 p(1-p)}{E^2} \]
| Symbol | Meaning |
|---|---|
| \(n\) | Required sample size |
| \(z\) | Standard-score multiplier for the confidence level |
| \(p\) | Estimated proportion |
| \(E\) | Desired margin of error |
Common values for \(z\) are 1.645 for 90% confidence, 1.96 for 95% confidence, and 2.576 for 99% confidence. A margin of error of 0.05 means plus or minus five percentage points.
Choosing the planning proportion
If earlier data is trustworthy and comes from the same process, use its proportion as \(p\). If no reliable estimate exists, use \(p = 0.5\).
The value 0.5 produces the largest value of \(p(1-p)\), so it produces the most conservative sample size. This avoids underestimating the required sample when the true rate is unknown.
For example, suppose you want to estimate an invoice defect rate with:
- 95% confidence
- A margin of error of 5 percentage points
- No reliable estimate of the defect rate
The calculation is:
\[ n = \frac{1.96^2(0.5)(1-0.5)}{0.05^2} = 384.16 \]
Always round up. The required sample is 385 invoices.
import math
# Sample size to estimate a proportion:
# n = z^2 * p * (1 - p) / E^2
z = 1.96 # 95% confidence
p = 0.5 # conservative value when the rate is unknown
E = 0.05 # plus or minus 5 percentage points
n = math.ceil(z**2 * p * (1 - p) / E**2)
print(n) # 385Connecting sample size to the sampling plan
The formula assumes that the observations represent the process you want to understand. A sample of 385 invoices collected only from one billing team may estimate that team’s rate, but not the rate for all teams.
Use the sampling strategy to match the question:
- Use a simple random sample when every unit should have an equal chance of selection.
- Use systematic sampling when you select every kth unit from an ordered stream.
- Use stratified sampling when important groups, such as teams or customer segments, must be represented.
- Use subgroup sampling when you need to study variation over time, shifts, machines, or locations.
If you plan to compare groups, the total sample must support those comparisons. A total of 385 observations may be adequate for one overall estimate but too small if divided among several teams.
Finite populations and practical adjustments
When the population is small compared with the planned sample, use a finite population correction. For a population of size \(N\), an adjusted sample size is:
\[ n_{\text{adjusted}} = \frac{n}{1 + \frac{n-1}{N}} \]
For example, if the initial calculation gives 385 but only 1,000 invoices exist in the period, the adjusted requirement is about 278. Document the population size and the formula used.
Sample size also does not correct biased collection. Collecting 385 convenient observations from easy cases can produce a precise estimate of the wrong population.
Exercise
You need a 95% confidence estimate with a margin of error of 10 percentage points, and the true proportion is unknown. What sample size should you plan for?
Show answer
Use z = 1.96, p = 0.5, and E = 0.10: n = 1.96^2 × 0.5 × 0.5 ÷ 0.10^2 = 96.04. Round up to 97 observations.