Process

Attribute Control Chart Calculator (p, np, c, u)

Paste counts of defectives or defects per sample and get the p, np, c or u chart centre line and control limits, per-sample limits when the sample size varies, and the samples outside them. Every value is entered by you; the tool adds no data of its own.

01Inputs

Defective means a unit that failed; defect means a flaw counted on a unit. Pick by what you counted and whether the sample size changed.

One sample per line as sample size,defectives (for example 100,4). Commas, tabs or spaces. 3 to 500 samples.

Number of units inspected in every sample.

Use only the first k samples to set the centre line and limits and apply them to every sample. Leave empty to use all samples.

02Result

03Method

Use this tool when what you record for each sample is a count rather than a measurement: how many units failed inspection, or how many flaws were found, and you want to know whether that rate is stable. It picks the right limits for the four classic attribute charts, computes the limits for each sample separately when the sample size changes, and lists the samples outside them. It assumes the samples are in time order, that each unit in a sample has the same chance of being defective (or that defects occur at a constant rate per unit), and that the counts are independent from sample to sample. For measurements use the Subgroup Control Chart Calculator or the I-MR Control Chart Calculator; the Which control chart for which data guide walks through the choice.

AHow it is calculated

The tool works on m samples in the order given and on a baseline of the first k samples (all m when no baseline is entered). For sample i, nᵢ is the number of units inspected and dᵢ the defectives found, or cᵢ the defects counted:

  1. p chart: the centre line pools the counts over the baseline, and each sample gets limits for its own size.
p̄ = Σdᵢ/Σnᵢ; limits p̄ ± 3√(p̄(1 − p̄)/nᵢ)
  1. np chart, with the same n in every sample: the centre line is n times the pooled fraction.
p̄ = Σdᵢ/(k·n); centre np̄; limits np̄ ± 3√(np̄(1 − p̄))
  1. c chart, one inspection unit of the same size per sample: the centre line is the average count.
c̄ = Σcᵢ/k; limits c̄ ± 3√c̄
  1. u chart: the centre line pools the defects over the units inspected, and each sample gets limits for its own number of units.
ū = Σcᵢ/Σnᵢ; limits ū ± 3√(ū/nᵢ)
  1. A lower limit that comes out negative is set to 0; there is then no lower limit, and a point can only be below a lower limit that is above 0.
  2. When the sample sizes of a p or u chart differ, every sample is judged against its own limits, drawn as steps on the chart; the UCL and LCL shown at the top are those at the average baseline sample size n̄.
  3. Every point above its UCL, or below its LCL when that LCL is above 0, is listed. Only these single-point tests are applied, with no run rules.

Worked example (c chart): 25 wafers inspected for defects, from the NIST/SEMATECH e-Handbook, with 400 defects in all. c̄ = 400/25 = 16.00, the limits are 16 ± 3√16, that is 4.00 to 28.00, and wafer 24 with 31 defects is above the UCL; the handbook prints the same 16, 28 and 4.

Worked example (p chart): 30 wafers of 50 chips each, also from the e-Handbook, with defective counts from 4 to 24. p̄ = 347/1500 = 0.2313, the limits are 0.2313 ± 3√(0.2313 × 0.7687/50), that is 0.0524 to 0.4102, and wafers 15 (0.4400) and 23 (0.4800) are above the UCL. Entered as an np chart with n = 50 the same data give np̄ = 11.57 and limits 2.62 to 20.51 with the same two wafers outside.

BScope and limitations
  • Binomial and Poisson assumptions. The p and np limits assume every unit in a sample has the same probability of being defective and the units are independent; the c and u limits assume defects arrive at a constant average rate and are independent. Clustered defects (one scratch counted as ten) or batches with a shared cause widen the real variation beyond the formula, and the chart then signals too often.
  • Large samples make the limits tight. With thousands of units per sample the 3σ limits sit so close to p̄ that ordinary day-to-day variation in the defect rate falls outside them; the chart is then detecting that the rate is not perfectly constant, which is true but not useful. Montgomery discusses the alternatives (limits from the between-sample variation); this tool does not implement them. Overdispersion in p and u charts explains the effect and works the Laney p′ chart by hand.
  • Varying sample size. For the p and u charts the limits are computed for each sample's own size and drawn as steps; the headline UCL and LCL are those at the average sample size and exist only to give one number to quote. A sample near a step can be outside its own limits while inside the headline ones, and the outside list uses its own.
  • Small counts. When p̄·n or c̄ is below about 5 the normal approximation behind the 3σ limits is poor, the lower limit is usually 0, and the chart can only signal upward; the Glossary entry Control limits says what the limits are and are not.
  • Single-point tests only; no run rules. The Glossary entry Run rules says what they are, and Control chart run rules explains why the zone rules need care on count charts.
  • The limits are only as good as the baseline, exactly as for the measurement charts: a baseline that already contains the problem hides it. Decide the baseline before looking at the chart.
  • Control limits are not specification limits or acceptance numbers. A sample inside the limits is consistent with the process as it has been running; whether that rate is acceptable is the AQL Sampling Plan question, not this one.
CCommon mistakes
  1. Charting defectives on a c chart. A defective is a failed unit out of n inspected (p or np chart); a defect is a flaw counted on a unit of fixed size (c or u chart). The limits differ because the first is binomial and the second Poisson.
  2. Using an np chart when the sample size changes. The np limits assume one n; with varying n the count rises and falls with the sample, and the chart signals the sample size. Use the p chart.
  3. Averaging the fractions instead of pooling the counts. p̄ is total defectives divided by total inspected, not the mean of the sample fractions; with unequal samples the two differ.
  4. Reading a lower limit of 0 as a limit. When the formula gives a negative lower limit there is no lower limit; a sample with zero defectives is not a signal of improvement by itself.
  5. Treating the chart as proof the defect rate is acceptable. In the c chart example the centre line is 16 defects per wafer; a process that stayed inside those limits would be stable at 16 defects per wafer, and stable is not the same as good.
  6. Mixing inspection units of different sizes on a c chart. If the units inspected per sample change, the counts are not comparable; use the u chart, which divides by the units inspected.

Further reading