Sub topic 10
u charts: defects per unit
This chapter assumes you can read an I-MR or p chart, know what a 3-sigma limit is, and have met the idea of a count of events per unit of opportunity. The Python examples use NumPy.
What a u chart measures
A u chart tracks the number of defects per unit of inspection. It applies when you count defects, not defective items. One item can have several defects. A circuit board might have three solder bridges and one missing label. A single invoice might have two wrong amounts and one wrong date.
The distinction from the p chart matters:
| Question | Count | Chart |
|---|---|---|
| How many items were bad? | Defective items out of items inspected | p chart |
| How many flaws were found? | Defects across the inspected area, length, or number of units | u chart |
The chart plots
u = c / n
where c is the number of defects found in a period and n is the size of the inspection unit (the area of opportunity). The n can be a count of boards, square meters of fabric, hours of call time, or pages reviewed. Plot u against time order, not c.
The model behind the limits
The u chart assumes defects occur independently, at a constant average rate, in the area you inspect. Under those assumptions the count c follows a Poisson distribution. A Poisson distribution has a variance equal to its mean, so the standard deviation of c is the square root of its expected value.
Write ū for the overall average defect rate:
ū = (total defects) / (total units inspected)
The standard deviation of u in one period is sqrt(ū / n). The limits are:
- Center line: ū
- Upper control limit: ū + 3 · sqrt(ū / n)
- Lower control limit: max(0, ū − 3 · sqrt(ū / n))
Notice that ū is a ratio of totals, not an average of the per-period u values. A period with a large n carries more information, and the ratio of totals weights it correctly. Averaging the u values would give a small sample the same weight as a large one.
Why the limits change with n
The n appears inside the square root, so each period has its own limits. A period with a larger inspection unit gives a more precise estimate of the rate, and its limits sit closer to the center line. The result is a stepped pattern of limits that is easy to misread as a sign of trouble. It is not. It reflects how much data stands behind each point.
A worked example
Suppose a team inspects batches of printed circuit boards. In each period they record the defects found (c) and the boards inspected (n).
| Period | Defects c | Boards n | u = c/n |
|---|---|---|---|
| 1 | 12 | 20 | 0.600 |
| 2 | 9 | 18 | 0.500 |
| 3 | 15 | 25 | 0.600 |
| 4 | 11 | 22 | 0.500 |
| 5 | 8 | 16 | 0.500 |
| 6 | 14 | 24 | 0.583 |
| 7 | 10 | 20 | 0.500 |
| 8 | 13 | 23 | 0.565 |
The totals are 92 defects over 168 boards, so ū = 92 / 168 ≈ 0.548 defects per board.
Take period 5, with n = 16. Then sqrt(0.548 / 16) ≈ 0.185, and 3 × 0.185 ≈ 0.555. The upper limit is about 1.10. The raw lower limit is 0.548 − 0.555 ≈ −0.007, which is below zero, so the LCL is floored at 0. A defect rate cannot be negative.
Take period 3, with n = 25. Then sqrt(0.548 / 25) ≈ 0.148, and 3 × 0.148 ≈ 0.444. The limits are about 0.104 and 0.992, noticeably tighter.
All eight points fall inside their limits, so this baseline shows no special-cause signal.
Computing it in Python
import numpy as np
c = np.array([12, 9, 15, 11, 8, 14, 10, 13]) # defects per period
n = np.array([20, 18, 25, 22, 16, 24, 20, 23]) # units inspected per period
u = c / n
u_bar = c.sum() / n.sum() # ratio of totals, not mean(u)
sigma = np.sqrt(u_bar / n) # one sigma per period
ucl = u_bar + 3 * sigma
lcl = np.maximum(0.0, u_bar - 3 * sigma)
print("u_bar:", round(u_bar, 4))
for i in range(len(u)):
flag = "SIGNAL" if (u[i] > ucl[i] or u[i] < lcl[i]) else "ok"
print(f"period {i + 1}: u={u[i]:.3f} LCL={lcl[i]:.3f} UCL={ucl[i]:.3f} {flag}")The loop compares each point with its own limits. Comparing every point with a single pair of limits is a common mistake when n varies.
Constant versus varying n
You can simplify when n is nearly constant. A common rule of thumb is that if every n lies within about 25% of the average n, you can use one pair of limits based on the average n. Some practitioners prefer to compute exact limits per point anyway, because software makes that free and the exact limits cannot mislead.
Because that block is not valid per the required format, here is the decision diagram in the correct form:
Choosing the unit of inspection
The area of opportunity must be defined before you collect data, and it must be the same kind of thing across periods. Some practical guidance:
- Pick a unit where defects can occur roughly uniformly. Defects per board works if boards are alike. Defects per board is misleading if you mix a simple board with a complex one.
- Choose n large enough that the average count per period is at least about 5 (some texts say 1 to 2 as a minimum). Counts that are very small make the normal approximation behind 3-sigma limits poor, and the chart will rarely signal.
- If the inspection unit is fixed (always exactly one board), you can use a c chart, which plots raw counts. The u chart is the generalization that handles variable n.
Reading the chart
Apply the same signal rules you use on other Shewhart charts, with one adjustment for varying limits.
- A point beyond its own control limit is a signal.
- A point below a lower limit is good news, but it deserves investigation, since it may be a change in inspection practice or recording and not a real improvement.
- Run rules, such as eight points in a row on one side of the center line, still work because the center line ū is constant. Rules that count points near the limits, such as two of three points beyond 2 sigma, are harder to apply when sigma changes per point. Check whether your software scales these zones per point.
When the lower limit is zero, no point can fall below it, so the chart cannot signal an improvement through that rule. Runs below the center line then become the main way to detect a drop in defect rate.
Limits and baselines
Set limits from a baseline period in which the process looked stable, as with any control chart. For a u chart, use at least 20 to 25 periods if you can, and make sure the total defect count in the baseline is large enough that ū is stable. Remove points explained by a known special cause, recompute ū, and then freeze the limits. Judge later data against the frozen ū and the per-point sigma computed from each new n.
Pitfalls specific to u charts
Overdispersion
Real defect counts often vary more than a Poisson model predicts. Causes include defects that cluster (one bad lot produces many flaws), differences between machines or shifts, and different part types lumped together. This is overdispersion. It makes the limits too narrow, and the chart signals constantly even though nothing special is happening.
A quick check compares the observed spread with the Poisson expectation:
import numpy as np
c = np.array([12, 9, 15, 11, 8, 14, 10, 13])
n = np.array([20, 18, 25, 22, 16, 24, 20, 23])
u_bar = c.sum() / n.sum()
expected = n * u_bar
chi_sq = np.sum((c - expected) ** 2 / expected)
dispersion = chi_sq / (len(c) - 1)
print("dispersion ratio:", round(dispersion, 2))A ratio near 1 fits the Poisson model. For this small data set it comes out around 0.09, which is well below 1 and raises no concern. A ratio well above 1, such as 2 or more, indicates overdispersion. In that case consider a u′ (Laney) chart, which adds an adjustment for the extra between-period variation, or restructure the data so that unlike items are charted separately.
Other common errors
- Averaging the u values instead of using total defects over total units.
- Using one fixed pair of limits when n varies a lot.
- Counting the same defect more than once, or counting defects inconsistently between inspectors. Write a clear operational definition of a defect.
- Treating defectives as defects. If each item is simply pass or fail, use a p chart.
- Ignoring autocorrelation. If one period's defects feed into the next (rework carried over, for example), points are not independent and the signal rules misfire.
Exercise
A call center reviews recordings. Over 10 weeks it finds 150 script errors in 600 reviewed calls. In week 11 it reviews 400 calls and finds 90 errors. Compute the center line and the 3-sigma limits for week 11. Is week 11 a signal?
Show answer
ū = 150 / 600 = 0.25 errors per call. For week 11, n = 400, so sigma = sqrt(0.25 / 400) = sqrt(0.000625) = 0.025, and 3 sigma = 0.075. The limits are LCL = 0.175 and UCL = 0.325. The week 11 rate is 90 / 400 = 0.225, which is inside the limits, so it is not a signal.
Exercise
Why must the u chart use total defects divided by total units for the center line, instead of the mean of the per-period u values? Give a short example in which the two differ.
Show answer
The mean of u values gives every period equal weight, even though periods with larger n contain more information. With period 1 at c = 1, n = 1 (u = 1) and period 2 at c = 10, n = 100 (u = 0.1), the mean of u is 0.55, but total defects over total units is 11 / 101 ≈ 0.109. The ratio of totals reflects the true overall rate. The mean of u is dominated by the tiny first period.
Exercise
A u chart for paint flaws per panel shows many points above the UCL, yet no one can find any change in the process. The dispersion ratio is 3.4. What is the most likely explanation and what would you do?
Show answer
The counts are overdispersed, so the Poisson-based limits are too narrow and produce false signals. Check whether different panel types, shifts, or machines are mixed together and chart them separately. If the extra variation is part of the normal process and cannot be split out, use a u′ (Laney) chart, which widens the limits to match the observed between-period variation.