How to use the attribute control chart maker
- Pick the chart type — or open “Which chart do I need?” and answer two questions.
- Enter the data with one subgroup per row in time order: subgroup label, sample size, count. Paste from a spreadsheet, type, or upload a .csv / .xlsx file. For a c chart, or when every sample has the same size, the size column can be left out.
- Choose where the limits come from: all subgroups, the first k subgroups (a Phase I baseline) or a known standard value. Subgroups with an assignable cause can be excluded from the calculation and still be plotted.
- Read the verdict, the chart, the list of signals and the warnings, then print or save a PDF report.
Which chart: p, np, c or u?
Two questions decide it. First, are you counting defective units (each unit is classified good or bad — binomial data) or defects (one unit, panel or metre can have several — Poisson data)? Second, is the sample size constant or does it vary?
| Constant sample size | Varying sample size | |
|---|---|---|
| Defective units | np chart (or p chart) | p chart |
| Defects | c chart (or u chart) | u chart |
If you have a measured value rather than a count, a variables chart is far more informative for the same inspection effort: use the X̄-R / X̄-S chart or the I-MR chart.
Formulas
| Chart | Plotted value | Centre line | Control limits (3σ) |
|---|---|---|---|
| p | pᵢ = dᵢ ÷ nᵢ | p̄ = Σd ÷ Σn | p̄ ± 3·√(p̄(1 − p̄) ÷ nᵢ) |
| np | dᵢ | n·p̄ | n·p̄ ± 3·√(n·p̄(1 − p̄)) |
| c | cᵢ | c̄ = Σc ÷ k | c̄ ± 3·√c̄ |
| u | uᵢ = cᵢ ÷ nᵢ | ū = Σc ÷ Σn | ū ± 3·√(ū ÷ nᵢ) |
Attribute charts need no table of constants: sigma follows from the binomial or Poisson model once the centre line is known. A negative lower limit is replaced by LCL = 0, and the upper limit of a p chart is capped at 1. Note that p̄ and ū are totals divided by totals, not the average of the subgroup ratios.
Varying sample sizes
For p and u charts the limits depend on nᵢ. By default the tool calculates exact limits for every subgroup, which gives stepped limit lines — narrower for large samples, wider for small ones. As a simplification you can use the average sample size n̄ to get straight limits; this is acceptable only when the sizes stay within about ±25% of n̄, and the tool warns when they do not. np and c charts require a constant sample size and are rejected otherwise.
Overdispersion and the Laney p′ / u′ chart
With very large samples (thousands of units per subgroup) the binomial or Poisson sigma becomes tiny, yet real processes vary a little from subgroup to subgroup, so almost every point falls outside the classical limits. Laney’s method converts each point to a z-score, zᵢ = (pᵢ − p̄) ÷ σᵢ, estimates the actual variation of the z-scores from their average moving range, σz = MR̄(z) ÷ 1.128, and uses limits p̄ ± 3·σᵢ·σz. If σz is close to 1 the result equals the ordinary chart.
Reading the chart and its limitations
A point above the UCL means the defect level rose beyond what chance explains; a point below a non-zero LCL is a signal too — either a real improvement worth understanding or a change in inspection. Run and zone tests are available, with the definitions used across these tools: a signal is reported at the point that completes the pattern, zone tests work per side of the centre line, and with stepped limits they use the standardised value (plotted value − centre line) ÷ σᵢ.
Two cautions apply to attribute data:
- Small expected counts. The 3σ limits rely on the normal approximation. When n·p̄ (or c̄) is below about 5 the distribution is skewed, the false-alarm rate is off and the lower limit is zero. The tool flags this; increase the sample size or combine subgroups.
- Run rules. The Western Electric and Nelson tests assume a symmetric distribution, so on attribute charts with low counts, treat everything except rule 1 as a prompt to look, not as proof.
Worked example (the p chart sample data)
Twenty-five lots are inspected; lot sizes vary from 160 to 250. In total 244 defectives are found in 5,100 units, so p̄ = 244 ÷ 5,100 = 0.0478.
Lot 17 has n = 160 and 19 defectives, p = 0.119. Its sigma is √(0.0478 × 0.9522 ÷ 160) = 0.0169, so UCL = 0.0478 + 3 × 0.0169 = 0.0985 and LCL = 0.0478 − 0.0506 < 0, which becomes 0. Since 0.119 > 0.0985, lot 17 is out of control. For a lot of 250 the UCL is only 0.0883 — this is why the limit line is stepped.
The methods follow Montgomery’s Introduction to Statistical Quality Control and the AIAG SPC manual. The tool reproduces Montgomery’s orange-juice-can p chart (p̄ = 0.2313, limits 0.0524 and 0.4102) and his printed-circuit-board c chart (c̄ = 19.85, limits 6.48 and 33.21 — the book prints 33.22 because it rounds c̄ first). To find which defect types to attack first, tally them with the Pareto chart maker; to convert a defect rate into a sigma level use the sigma level calculator.
Frequently asked questions
What is the difference between a p chart and an np chart?
Both track defective units. The p chart plots the proportion defective in each sample and works with any sample size. The np chart plots the number of defectives and requires every sample to be the same size. With a constant sample size they give exactly the same signals.
What is the difference between a c chart and a u chart?
Both track defects, where one unit can have several. The c chart plots the number of defects per sample and needs a constant sample size or area. The u chart plots defects per unit and handles sample sizes that change from subgroup to subgroup.
Why are the control limits on my p chart stepped?
The standard deviation of a proportion depends on the sample size, so each subgroup has its own 3-sigma limits: larger samples get tighter limits. If the sample sizes are within about 25 percent of their average, limits based on the average sample size can be used instead.
Why is the lower control limit zero?
When the centre line minus three sigma is negative, the lower limit is set to zero because a count or proportion cannot be negative. The chart can then only signal increases. A larger sample size raises the expected count and gives a lower limit above zero.
How large should the sample be for a p chart?
A common guideline is that the expected number of defectives per sample, n times p-bar, should be at least 5, and the expected number of good units at least 5 as well. For a process running at 1 percent defective this means samples of 500 or more.
When should I use a Laney p-prime chart?
Use it when the samples are very large and the ordinary p chart shows most points outside the limits. That is a sign of overdispersion: real subgroup-to-subgroup variation larger than the binomial model predicts. The Laney chart widens the limits by a factor estimated from the data.