P chart: control chart for proportion defective
A P chart plots the proportion of defective (nonconforming) items in each sample over time. Each item is classified as good or bad, and the chart asks whether the fraction of bad items is stable. Its control limits come from the binomial distribution and get wider for small samples and narrower for large ones, so the P chart handles sample sizes that change from one period to the next.
When to use it
- Each item either passes or fails: a leak test, a visual inspection, a rejected lab specimen, a late delivery.
- You count the defective items in each sample and know the sample size.
- Sample sizes vary, for example the number of items produced or received each day.
If every sample has the same size, the NP chart plots the count directly and is easier to read. If you count defects (several possible per item) instead of defective items, use the U chart or C chart. If your samples are very large (thousands) and many points fall outside the limits, see the Laney P′ chart.
How it works
For each sample i, with nᵢ items of which xᵢ are defective, the plotted point is pᵢ = xᵢ / nᵢ. The center line is the overall proportion, which weights each sample by its size:
p̄ = Σxᵢ / ΣnᵢThe limits for each sample use that sample's size:
UCLᵢ = p̄ + 3√( p̄(1 − p̄) / nᵢ )
LCLᵢ = max(0, p̄ − 3√( p̄(1 − p̄) / nᵢ ))The ±3 standard error limits rely on the normal approximation to the binomial, which works well when nᵢp̄ is at least about 5. With small p̄ and small samples, the lower limit is 0 and a sudden improvement cannot show up as a point below it.
Use Tests 1 to 4 of the tests for special causes. With varying sample sizes, apply them to the standardized values (pᵢ − p̄)/σᵢ, so that "one side of the center line" and "beyond the limit" mean the same thing for every sample. The binomial distribution is skewed for small p, so the zone tests are not used.
Example
A hospital's central laboratory rejects blood specimens that arrive hemolyzed, because broken red cells distort potassium and other results. The quality coordinator counts, each day, the specimens received for chemistry (nᵢ) and the number rejected for hemolysis (xᵢ):
| Day | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| n | 396 | 402 | 441 | 473 | 325 | 343 | 452 | 472 | 360 | 370 |
| x | 14 | 12 | 12 | 17 | 8 | 10 | 10 | 13 | 8 | 9 |
| Day | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|
| n | 459 | 388 | 363 | 453 | 361 | 385 | 423 | 408 | 333 | 324 |
| x | 16 | 10 | 11 | 41 | 17 | 13 | 13 | 10 | 7 | 16 |
In total, 267 of 7,931 specimens were hemolyzed: p̄ = 0.0337, or 3.37%.
- Day 1 (n = 396): σ₁ = √(0.0337 × 0.9663 / 396) = 0.00906, so UCL = 0.0337 + 3 × 0.00906 = 0.0609 and LCL = 0.0065.
- Day 14 (n = 453): UCL = 0.0591. The observed proportion is 41/453 = 0.0905.
Day 14 is far above its upper limit. Most of that day's rejected specimens came from the emergency department, whose pneumatic tube line had been reset to a higher speed after maintenance. Once the speed was restored, day 14 is removed from the baseline: p̄ = 226/7,478 = 0.0302, and the limits are recomputed from that value.
How to read the results
- A point above the upper limit means more defectives than chance explains for a sample of that size. Look for what was different that day.
- A point below the lower limit means unusually few defectives. It is worth a look too: it can be a real improvement, or a change in how items were inspected or recorded.
- Limits that step up and down are expected with varying sample sizes. A point near the center line on a small day can be less meaningful than the same point on a large day.
- The center line is the long-run defective rate. If 3% hemolysis is too high, the process needs a change in its system (collection technique, transport), not a reaction to single days.
Common mistakes
- Averaging the daily proportions for p̄. That gives small days the same weight as large ones. Use total defectives divided by total items.
- Using one set of limits for all samples when sizes differ by more than about 25%. Compute the limits for each nᵢ.
- Counting defects instead of defective items. If one specimen can fail for two reasons, you are counting defects, and the U chart is the right model.
- Very large samples. With thousands of items per sample, small real day-to-day changes in the rate push many points outside the limits. Check for overdispersion and consider the Laney P′ chart.
Frequently asked questions
What is the difference between a P chart and an NP chart?
The P chart plots the proportion defective and allows sample sizes to vary. The NP chart plots the number defective and requires a constant sample size. With constant sizes, they show the same pattern.
How large should each sample be?
Large enough that you expect a few defectives in most samples: n × p̄ of 5 or more is a common guideline. For a 3% rate, that means at least about 170 items per sample.
Why is the lower limit sometimes zero?
When p̄ − 3σᵢ is negative, which happens with small samples or low defect rates, the lower limit is set to zero, since a proportion cannot be negative.
Can I use a P chart for capability?
The center line p̄ is the process's defective rate, which is its capability for pass/fail data. A binomial capability analysis adds a confidence interval and converts the rate to parts per million.