NPCHART Statement: SHEWHART Procedure

Creating np Charts from Count Data

Note: See np Chart Examples in the SAS/QC Sample Library.

An electronics company manufactures circuits in batches of 500 and uses an $np$ 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,[32], 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 17.50.

Figure 17.50: 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 $np$ chart shown in Figure 17.51:

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 17.51: $np$ Chart for Circuit Failures (Traditional Graphics)


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

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$\sigma $ 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.



[32] This data set is also used in the Getting Started section of PCHART Statement: SHEWHART Procedure