See SHWCCHR1 in the SAS/QC Sample LibraryIn the previous example, control limits were saved in a SAS data set named Deflim
. This example shows how these limits can be applied to defect data for a second group of trucks, which are provided in the
following data set:
data Trucks2; input TruckID $ Defects @@; label TruckID='Truck Identification Number' Defects='Number of Paint Defects'; datalines; R1 7 R2 3 R3 3 R4 14 R5 7 R6 9 R7 3 R8 11 S4 6 S9 8 S7 3 S6 10 T3 9 T4 4 T7 7 X1 7 X2 18 X3 3 X9 11 X4 5 ;
The following statements plot the number of paint defects for the second group of trucks on a c chart using the control limits in Deflim
. The chart is shown in Figure 17.19.
options nogstyle; goptions ftext=swiss; symbol v=dot color=red height=.8; title 'c Chart for Paint Defects in New Trucks'; proc shewhart data=Trucks2 limits=Deflim; cchart Defects*TruckID / cframe = steel cconnect = red cinfill = ligr coutfill = yellow ; run; options gstyle;
The NOGSTYLE system option causes ODS styles not to affect traditional graphics. Instead, the SYMBOL statement and CCHART statement options control the appearance of the graph. The GSTYLE system option restores the use of ODS styles for traditional graphics produced subsequently.
Note that the number of defects on the truck with identification number X2 exceeds the upper control limit, indicating that the process is out-of-control. The LIMITS= option in the PROC SHEWHART statement specifies the data set containing the control limits. By default,[54] this information is read from the first observation in the LIMITS= data set for which
the value of _VAR_
matches the process name Defects
the value of _SUBGRP_
matches the subgroup-variable name TruckID
In this example, the LIMITS= data set was created in a previous run of the SHEWHART procedure. You can also create a LIMITS= data set with the DATA step. See LIMITS= Data Set for details concerning the variables that you must provide.
[54] In SAS 6.09 and in earlier releases, it is also necessary to specify the READLIMITS option to read control limits from a LIMITS= data set.