Chapter Contents 
Previous 
Next 
CCHART Statement 
See SHWCCHR1 in the SAS/QC Sample Library 
A department store receives boxes of shirts containing 10, 25, or 50 shirts. Each box is inspected, and the total number of defects per box is recorded. The following statements create a SAS data set named SHIRTS2, which contains the total defects per box for 20 boxes:
data shirts2; input box flaws nshirts @@; datalines; 1 3 10 2 8 10 3 15 25 4 20 25 5 9 25 6 1 10 7 1 10 8 21 50 9 3 10 10 7 10 11 1 10 12 21 25 13 9 25 14 3 25 15 12 50 16 18 50 17 7 10 18 4 10 19 8 10 20 4 10 ;
A listing of SHIRTS2 is shown in Figure 33.8.
The variable BOX contains the box number, the variable FLAWS contains the number of flaws in each box, and the variable NSHIRTS contains the number of shirts in each box. To evaluate the quality of the shirts, you should report the average number of defects per shirt. The following statements create a data set containing the number of flaws per shirt and the number of shirts per box:
proc shewhart data=shirts2; cchart flaws*box / subgroupn =nshirts outhistory=shrthist nochart; run;
The SUBGROUPN= option names the variable in the DATA= data set whose values specify the number of inspection units per subgroup. The OUTHISTORY= option names an output data set containing the number of nonconformities per inspection unit and the number of inspection units per subgroup. A listing of SHRTHIST is shown in Figure 33.9.

There are three variables in the data set SHRTHIST.
Note that the variables containing the numbers of nonconformities per inspection unit and subgroup sample sizes are named by adding the suffix characters U and N to the process DEFECTS specified in the CCHART statement. In other words, the variable naming convention for OUTHISTORY= data sets is the same as that for HISTORY= data sets.
For more information, see "OUTHISTORY= Data Set" .
Chapter Contents 
Previous 
Next 
Top 
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.