Understanding the p-chart control limits calculator — concept and principle
A p-chart monitors the fraction of defective items in successive samples, for example the share of rejected invoices each day or of failed boards in each lot. It is the Shewhart control chart for attribute (pass/fail) data. This calculator gives the upper and lower 3-sigma control limits from the long-run average fraction defective and the sample size.
How it is calculated
- Centre line: p̄, the total number of defectives divided by the total number inspected.
- UCL = p̄ + 3 × √(p̄(1 − p̄) / n)
- LCL = p̄ − 3 × √(p̄(1 − p̄) / n), set to 0 if the formula gives a negative value.
p̄ is entered as a fraction (0.04 = 4%) and n is the number of items in each sample.
The principle
If each item independently has the same probability p of being defective, the count in a sample of n follows a binomial distribution. The sample fraction then has mean p and standard deviation √(p(1 − p)/n). Setting limits three of those standard deviations either side of p̄ follows Shewhart's rule: when the process is stable, points fall outside only rarely, so a point beyond the limits suggests something has changed. Larger samples shrink the standard deviation and tighten the limits.
Worked example
- Inputs: p̄ = 0.04, n = 200.
- Standard deviation: √(0.04 × 0.96 / 200) = √0.000192 = 0.013856.
- Three standard deviations: 3 × 0.013856 = 0.041569.
- UCL = 0.04 + 0.041569 = 0.08157 (about 8.16%).
- LCL = 0.04 − 0.041569 = −0.00157, which is negative, so LCL = 0.
| Average fraction defective p̄ | UCL |
|---|---|
| 0.01 | 0.0311068709 |
| 0.02 | 0.0496984848 |
| 0.03 | 0.0661870143 |
| 0.04 | 0.0815692194 |
| 0.05 | 0.096233105 |
| 0.06 | 0.1103785669 |
| 0.08 | 0.1375499783 |
How to read the result
Plot each sample's fraction defective. A point above the UCL indicates a likely special cause making things worse; with a positive LCL, a point below it can mean a real improvement or an inspection problem. With an LCL of 0, as here, the chart cannot signal improvement from single points, so look for long runs below the centre line. If sample sizes vary, each sample needs its own limits, or the data should be standardised.
Common mistakes
- Entering p̄ as a percentage (4) instead of a fraction (0.04).
- Using a p-chart for counts of defects per unit, which call for a c- or u-chart.
- Using samples so small that n × p̄ is well below about 5, where the normal approximation behind 3-sigma limits is poor.
- Setting p̄ from a period that included known special causes.
Frequently asked questions
What is the difference between a p-chart and an np-chart?
A p-chart plots the fraction defective; an np-chart plots the number defective and is easier to read when every sample has the same size.
Why is the LCL zero?
Because p̄ − 3σ is negative and a fraction cannot be below zero.
How large should samples be?
Large enough that you expect several defectives per sample; a positive LCL needs n > 9(1 − p̄)/p̄, which is n > 216 at p̄ = 0.04.
Sources: ISO 7870-2, Control charts — Part 2: Shewhart control charts · D. C. Montgomery, Introduction to Statistical Quality Control, Wiley