Creating np Charts from Count Data

[See SHWNP1 in the SAS/QC Sample Library]An electronics company manufactures circuits in batches of 500 and uses an chart to monitor the number of failing circuits. Thirty batches are examined, and the failures in each batch are counted. The following statements create a SAS data set named Circuits,1, which contains the failure counts:

data Circuits;
  input Batch Fail @@;
  datalines;
1    5   2   6   3  11   4   6    5   4
6    9   7  17   8  10   9  12   10   9
11   8  12   7  13   7  14  15   15   8
16  18  17  12  18  16  19   4   20   7
21  17  22  12  23   8  24   7   25  15
26   6  27   8  28  12  29   7   30   9
;

A partial listing of Circuits is shown in Figure 15.52.

Figure 15.52 The Data Set Circuits
Number of Failing Circuits

Batch Fail
1 5
2 6
3 11
4 6
5 4

There is a single observation for each batch. The variable Batch identifies the subgroup sample and is referred to as the subgroup-variable. The variable Fail contains the number of nonconforming items in each subgroup sample and is referred to as the process variable (or process for short).

The following statements create the chart shown in Figure 15.53:

ods graphics off;
title 'np Chart for the Number of Failing Circuits';
proc shewhart data=Circuits;
   npchart Fail*Batch / subgroupn = 500;
run;

This example illustrates the basic form of the NPCHART statement. After the keyword NPCHART, you specify the process to analyze (in this case, Fail), followed by an asterisk and the subgroup-variable (Batch).

The input data set is specified with the DATA= option in the PROC SHEWHART statement. The SUBGROUPN= option specifies the number of items in each subgroup sample and is required with a DATA= input data set. The SUBGROUPN= option specifies one of the following:

  • a constant subgroup sample size (in this case)

  • a variable in the input data set whose values provide the subgroup sample sizes (see the next example)

Options such as SUBGROUPN= are specified after the slash (/) in the NPCHART statement. A complete list of options is presented in the section Syntax: NPCHART Statement.

Figure 15.53 Chart for Circuit Failures (Traditional Graphics)
np Chart for Circuit Failures (Traditional Graphics)

Each point on the chart represents the number of nonconforming items for a particular subgroup. For instance, the value plotted for the first batch is .

Since all the points fall within the control limits, it can be concluded that the process is in statistical control.

By default, the control limits shown are 3 limits estimated from the data; the formulas for the limits are given in Control Limits. You can also read control limits from an input data set; see Reading Preestablished Control Limits. For computational details, see Constructing Charts for Number Nonconforming (np Charts). For more details on reading raw data, see DATA= Data Set.