Attribute control charts: counting instead of measuring

Counted data rather than measured: proportion defective, number defective, defects per unit. Limits that step with the sample size instead of pretending it never changed, and an honest warning when the counts are too low for three-sigma limits to mean anything.

Nothing you paste leaves this calculation. It is not stored, not logged and not sent anywhere else — the numbers are computed and returned, and that is all.

Count and sample size per line. If the sample size never changed you can paste one column and give it once, on the right.

Which of the four you need

Two questions settle it, and neither is about the chart.

First: are you counting defective items, or defects? A door with three scratches is one defective door and three defects. If a unit is either good or bad, you want p or np. If a unit can carry several faults and you are counting the faults, you want u or c.

Second: does the sample size hold still? If you inspect exactly 100 every hour, the constant-n charts are available. If you inspect whatever the shift produced, you need the ones that cope with a varying sample.

Constant sampleVarying sample
Defective itemsnp or pp
Defectsc or uu

p and u work either way, so when in doubt they are the safe answer. np and c are only conveniences: they plot a raw count instead of a rate, which is easier to read on the floor, and they are unavailable the moment the sample size moves.

Why the limits look like a staircase

Because they should. The limits on a p chart are p̄ ± 3√(p̄(1−p̄)/nᵢ), and that nᵢ is the size of that particular sample. A big sample gives a precise proportion and narrow limits; a small one gives a noisy proportion and wide limits. So the limits step in and out as the sample size changes, and the chart is right to look uneven.

The common shortcut is to compute one pair of limits from the average sample size and draw them straight across. It looks tidier and it is wrong in both directions: points from small samples get judged against limits that are too tight and raise false alarms, and points from large samples get judged against limits that are too loose and hide real ones.

The honest limitation: low counts break the maths

The three-sigma limits assume the binomial or Poisson count is roughly normal, and at low counts it is not. The usual guidance is that the expected count per sample should be at least five — n·p̄ ≥ 5 for a p chart, n·ū ≥ 5 for a u chart.

Below that, the limits are wrong, and the lower one is wrong first. This tool says so when it happens rather than drawing a confident chart over a broken assumption. If your counts are that low, the answer is usually a bigger sample, a longer period per point, or measuring something instead of counting it.

A lower limit of zero is not good news

When the computed lower limit comes out negative it is clamped to zero, because a count cannot be negative. That is arithmetic, not reassurance.

A chart whose lower limit sits at zero everywhere has no power to detect an improvement at all. Nothing can ever fall below the limit, so a genuine reduction in defects — the outcome you presumably want — cannot signal. Only deterioration can. That is worth knowing before you use the chart to prove a fix worked, and the tool reports the sample size you would need for a real lower limit to exist.

Measure rather than count, where you can

An attribute chart throws away almost everything. "Out of tolerance" is one bit of information; the actual dimension is far more. A variables chart on the same process detects a shift far sooner and with far fewer parts, because it can see the process approaching the limit rather than waiting for it to cross.

Attribute charts are for the cases where measuring is genuinely impossible or absurd — a paint finish, a weld that passes or fails, a form filled in correctly. Not for the cases where measuring is merely more effort.

Questions people ask about this

What is the difference between a p chart and a c chart?

A p chart counts defective items — each unit is either good or bad — and plots the proportion. A c chart counts defects, where one unit can carry several, and plots the number per batch. A door with three scratches is one defective door and three defects, which is the whole distinction.

When do I use np instead of p?

Only when the sample size is constant. np plots the raw count rather than the proportion, which is easier to read on the shop floor, but it has no way to cope with a sample that changes size. p works either way, so when in doubt use p.

Why are my control limits not straight?

Because your sample size varies, and that is correct. The limits depend on the size of each individual sample — a big sample gives a precise proportion and narrow limits, a small one gives wide limits. Using one pair computed from the average sample size raises false alarms on the small samples and hides real signals on the large ones.

Why is my lower control limit zero?

Because the computed value came out negative and a count cannot be negative. It is arithmetic, not reassurance: a chart whose lower limit is zero throughout has no power to detect an improvement at all, since nothing can fall below it. Only deterioration can signal, which matters if you meant to use the chart to prove a fix worked.

How big a sample does an attribute chart need?

Large enough that the expected count per sample is at least about five — n times p-bar for a p chart. Below that the normal approximation behind the three-sigma limits fails and the limits are wrong, the lower one first. This tool says so rather than drawing a confident chart over a broken assumption.

Want this to keep itself up to date?

A calculator answers for the data you pasted. A control chart answers for the data your line produced this morning — limits frozen at a baseline you locked, rules evaluated on every new reading, an alert when one trips.

More control charts tools

  • Control limit calculator — Give it subgroups or individual readings and it returns the control limits for the chart, the range or sigma chart beneath it, and every constant it used to get there.
  • Control chart generator — Paste a column of numbers, or rows of subgroups, and get a real control chart: limits from the data, Nelson rules 1–4 evaluated, out-of-control points marked.
  • Nelson & Western Electric rules checker — Every run rule evaluated on your data, each violation named in plain English with what it usually indicates — a shift, a trend, tool wear, two machines mixed.
  • X̄-R chart calculator — Subgroups in, X̄ and R charts out — limits from A₂, D₃ and D₄, run rules evaluated, and the range chart shown first because it decides whether the averages chart can be trusted.
  • X̄-s chart calculator — For subgroups big enough that the range wastes them. Limits from A₃, B₃ and B₄, sigma recovered with the c₄ correction, and the s chart read first because it decides whether the averages chart can be trusted.
  • I-MR chart calculator — For processes that give you one number at a time — a batch, an oven, a destructive test. Limits from the mean moving range, run rules evaluated, and an honest note about what an individuals chart cannot see.

Everything else

  • Cp / Cpk calculator — Paste measurements — or type a mean and a sigma — with your tolerance, and get Cp, Cpk, Pp, Ppk, the sigma level and the expected parts per million out of spec.
  • Cpk confidence interval & sample size — A Cpk of 1.33 from 30 pieces has a 95% interval of roughly 0.97 to 1.69. See the uncertainty in your own number, and how many parts would settle it.
  • Cpk ↔ PPM ↔ sigma level converter — What PPM is a Cpk of 1.33? What Cpk does 3.4 PPM need? Both conventions shown side by side, because the 1.5 sigma shift is why two sources disagree by a factor of ten.
  • Control chart constants — The whole table, n = 2 to 25, with the formula each constant belongs to. The same values the charts on this site are computed from.
  • Levey-Jennings chart with Westgard rules — Paste your QC results with the assigned mean and SD from the package insert, and get the chart with every sigma band drawn and all six Westgard rules evaluated — each one named, and labelled random or systematic error.
  • Bland-Altman plot — Paired readings from two methods, plotted as difference against average — with the bias, the limits of agreement, their confidence intervals, and a test for whether the disagreement depends on the magnitude.
  • Pareto chart generator — Categories and counts in, ranked bars and the cumulative line out — with the vital few named, an "Other" bucket that always sorts last, and an honest warning when the distribution is flat and there is no dominant cause to attack.
  • Box and whisker plot generator — One column per group, boxes side by side. Quartiles, the 1.5×IQR fences, whiskers that stop at real readings and outliers drawn individually — with the quartile method stated, because that is why your plot and Excel's disagree.
  • Histogram and normality test — A histogram with the fitted normal curve, both standard bin rules with a reasoned recommendation, and an Anderson-Darling test that refuses to tell you your data is normal — because no test can.
  • Gage R&R calculator (ANOVA) — Paste a crossed study — part, operator, reading — and get the full ANOVA: repeatability and reproducibility separated, the part-by-operator interaction tested rather than assumed away, %GRR, %Tolerance and ndc against AIAG's bands.
  • Grubbs outlier test — The G statistic against its critical value, the p-value, and the point implicated — plus a straight answer about what to do next, which is almost never to delete the reading.
  • Scatter diagram and correlation — Paired readings plotted, with Pearson r, Spearman rho, r², the least-squares line and its p-value — and the two reported together, because when they disagree the disagreement is the finding.
  • Standard deviation calculator — The usual summary statistics, and the thing a spreadsheet will not tell you: the within-subgroup sigma a control chart uses, beside the overall sigma a textbook means. The gap between them is why Cpk and Ppk disagree.