liveBook · Manning

Np-chart

As explained in Statistics Every Programmer Needs

An np-chart is an attribute control chart that tracks the number of defective items in successive samples of fixed size.

An np-chart is an attribute control chart that plots the number of defective items in successive samples of fixed size. It supports rapid visual monitoring of process stability, helping quality teams identify unusual variation, investigate causes, and apply corrective action. section 14.0 section 14.2.2

Use an np-chart when:

  • Each observation contains the same number of inspected units. section 14.2
  • The monitored value is D, the count of units that fail the specified quality criteria. section 14.1.7
  • A direct count is easier to interpret than the defective proportion tracked by a p-chart. section 14.2 section 14.2.2
  • Sample sizes vary, use a p-chart instead; when one unit can contain multiple defects, consider a c-chart. section 14.1.7 section 14.2

Orange juice cans

For the oj data frame, each batch contains 50 cans. Compute the mean defective count, np-bar, then set the demonstrated limits at two standard deviations: UCL = np-bar + 2√np-bar and LCL = np-bar − 2√np-bar. Plot D by sample, draw the mean and limits, and highlight points outside them. The example shows a generally stable process, with two points above the UCL requiring investigation for possible special-cause variation. section 14.2.2

How Statistics Every Programmer Needs covers it

How deep it goes
Defines the measure, selects the chart by sample-size condition, and demonstrates calculation and plotting, but does not develop statistical derivations.
Examples
Uses orange-juice can batches of 50 units, a Matplotlib chart, two-standard-deviation limits, and two points above the UCL.
What it assumes
Assumes familiarity with samples, defective units, means, standard deviations, and basic control-chart terms such as UCL and LCL.
What you can do after
Apply it via Python and Matplotlib to calculate limits, plot defective counts, and flag observations outside control limits.
How it connects
Contrasts with p-charts for proportions and c-charts for defect counts, while fitting broader attribute control-chart analysis.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.