Sub topic 14
Sample size and confidence in a Cpk estimate
This chapter assumes you can compute Cp and Cpk from a mean, a standard deviation and specification limits. It also assumes you know that the standard deviation comes from a stable process, ideally from subgroup ranges (R-bar/d2). Here we deal with a question the earlier chapters skipped: how much should you trust the number you computed?
A Cpk is an estimate, not a fact
Every Cpk you calculate uses a sample mean and a sample standard deviation. Both change from sample to sample. Draw 30 parts today and 30 tomorrow from the same unchanged process, and you will get two different Cpk values.
The process has one true Cpk, computed from its true mean and true sigma. You never see it. You see an estimate, and the estimate scatters around the truth. How widely it scatters depends mostly on the sample size.
A report that says "Cpk = 1.45" hides this. A better report says "Cpk = 1.45, 95% lower confidence bound 1.12, n = 50." The second form tells the reader what the data support.
Where the uncertainty comes from
Three sources of error combine in a Cpk estimate.
- Mean error. The sample mean differs from the true mean. This moves the distance to the nearest limit.
- Sigma error. The sample standard deviation differs from the true sigma. This matters most when the process is well centered, because Cpk then depends mainly on sigma.
- Selection of the nearer limit. Cpk is the smaller of Cpu and Cpl. When the two values are close, the minimum picks up the noise from whichever side happens to be lower, which pushes the estimate slightly downward.
Sigma error usually dominates. A standard deviation from 10 values is a rough estimate. One from 100 values is much better, but its relative error shrinks only with the square root of the sample size. Quadrupling the data cuts the error roughly in half.
An approximate confidence interval
A widely used large-sample approximation (often credited to Bissell) gives the standard error of a Cpk estimate:
SE(Cpk) ≈ sqrt( 1/(9n) + Cpk² / (2(n − 1)) )
A two-sided 95% interval is then Cpk ± 1.96 × SE.
The formula has two terms. The first, 1/(9n), comes from error in the mean. The second grows with Cpk², which comes from error in sigma. A process with a high Cpk therefore has a wider absolute interval than one with a low Cpk at the same n.
from math import sqrt
from statistics import NormalDist
def cpk_interval(cpk, n, confidence=0.95):
z = NormalDist().inv_cdf(1 - (1 - confidence) / 2)
se = sqrt(1 / (9 * n) + cpk**2 / (2 * (n - 1)))
return cpk - z * se, cpk + z * se
for n in (10, 30, 100, 300):
low, high = cpk_interval(1.33, n)
print(n, round(low, 2), round(high, 2))The output is:
10 0.68 1.98
30 0.97 1.69
100 1.13 1.53
300 1.22 1.44An observed Cpk of 1.33 from 10 parts is compatible with a true Cpk below 0.7 or above 1.9. From 30 parts the range is still wide enough that the process could be marginal or very good. Even at 300 parts the interval is about ±0.11.
The bars show diminishing returns. Going from 10 to 30 parts removes almost 0.3 of half-width. Going from 100 to 300 removes less than 0.1, and costs far more measurements.
Using a lower bound to make a decision
Customers often require a minimum Cpk, commonly 1.33. A point estimate above 1.33 does not show that the process meets the requirement, because the true value may be lower. A safer rule is to require the lower confidence bound to clear the target.
For this decision a one-sided bound is appropriate, because you only care about the process being too poor. A one-sided 95% bound uses z = 1.645 instead of 1.96.
The next script finds the smallest observed Cpk that passes this test at each sample size.
from math import sqrt
from statistics import NormalDist
def lower_bound(cpk, n, confidence=0.95):
z = NormalDist().inv_cdf(confidence)
se = sqrt(1 / (9 * n) + cpk**2 / (2 * (n - 1)))
return cpk - z * se
def required_cpk(target, n, confidence=0.95):
cpk = target
while lower_bound(cpk, n, confidence) < target:
cpk += 0.001
return cpk
for n in (30, 100, 300):
print(n, round(required_cpk(1.33, n), 2))It prints approximately:
30 1.71
100 1.52
300 1.43To demonstrate a true Cpk of at least 1.33 with 95% confidence, a study of 30 parts needs an observed Cpk near 1.71. A study of 300 parts needs only about 1.43. Small studies force the process to be much better than the requirement before you can claim it meets the requirement.
Subgroups, degrees of freedom and study size
When sigma comes from R-bar/d2 instead of the overall sample standard deviation, the effective information is somewhat lower than the raw count of measurements suggests. A range uses only the two extreme values in each subgroup. Estimating sigma from ranges of subgroups of five is a little less efficient than using all five values.
For this reason, capability studies traditionally use about 25 subgroups of size 4 or 5, which is 100 to 125 measurements. That gives a lower-bound half-width in the region of ±0.2 for a Cpk near 1.33. It is a practical minimum, not a guarantee of precision.
Two further points apply to subgroup-based studies.
- Collect the subgroups over enough time to see the normal sources of variation. If you take 100 consecutive parts in 10 minutes, you measure short-term noise only. The interval will look tight, but it will not describe the process over a shift or a week.
- Check stability on a control chart before computing the interval. If the chart shows a shift or trend, the Cpk has no single true value to estimate, and the confidence interval has no meaning.
Bias and other practical limits
Small-sample bias. The sample Cpk is slightly biased in small samples. Part of the reason is the minimum in its definition, and part is the nonlinear relationship between sigma and the index. The effect is small compared with the random error, but it is another reason not to over-read a result based on 10 or 15 parts.
Measurement error. The standard deviation you observe includes the variation of the measurement system. If gauge variation is a large share of the observed spread, the estimated Cpk is lower than the true process Cpk. Confirm the gauge is adequate before you run a capability study.
Non-normal data. When the distribution is skewed, the interval above can be badly wrong. Transform the data or fit a suitable non-normal distribution first, and consider a bootstrap interval.
Autocorrelation. If consecutive parts are correlated, for example because of tool wear or temperature drift, the effective sample size is smaller than n. The interval from the formula will be too narrow.
Rounding and resolution. If the gauge resolution is coarse relative to the process spread, many measurements repeat the same value. The sigma estimate and the index become unreliable.
Reporting practice
Include the following with any Cpk result:
- The sample size and the number and size of subgroups.
- The time span of the data.
- The method for estimating sigma (R-bar/d2 or the overall standard deviation).
- Evidence of stability and an assessment of normality.
- A confidence interval or a lower bound, with its confidence level.
A table is a compact way to show how conclusions change with the lower bound.
| Observed Cpk | n | One-sided 95% lower bound | Meets 1.33 with confidence? |
|---|---|---|---|
| 1.50 | 30 | about 1.14 | No |
| 1.50 | 100 | about 1.31 | No |
| 1.80 | 30 | about 1.40 | Yes |
The lower bounds follow from the formula, with the table values rounded to two decimals.
Exercise
A stable, approximately normal process is studied with 50 independent measurements. The observed Cpk is 1.50. Use the approximate formula to find the two-sided 95% confidence interval. Can you claim the true Cpk is at least 1.33?
Show answer
SE = sqrt(1/(9×50) + 1.5²/(2×49)) = sqrt(0.002222 + 0.022959) = sqrt(0.025181) ≈ 0.159. The half-width is 1.96 × 0.159 ≈ 0.31, so the interval is about 1.19 to 1.81. The lower end is below 1.33, so you cannot claim with 95% confidence that the true Cpk meets 1.33. You need more data, or a better observed Cpk.
Exercise
A supplier reports Cpk = 2.0 from one study of 12 parts taken consecutively in a single hour. Give two reasons the figure should not be taken at face value.
Show answer
First, with n = 12 the standard error is large. The approximate formula gives SE ≈ sqrt(1/108 + 4/22) ≈ 0.52, so the 95% interval is roughly 1.0 to 3.0. Second, consecutive parts from one hour capture only short-term variation and say nothing about stability over shifts, tool changes or material lots. The study does not show the process is stable, so the Cpk may not describe how the process behaves in production.