The SHEWHART Procedure |
[See SHWCCHR1 in the SAS/QC Sample Library]You can save the control limits for a chart in a SAS data set; this enables you to apply the control limits to future data (see the section Reading Preestablished Control Limits) or subsequently modify the limits with a DATA step program.
The following statements read the data set Trucks introduced in Creating c Charts from Defect Count Data and saves the control limit information displayed in Figure 13.7.5 in a data set named Deflim:
proc shewhart data=Trucks; cchart Defects*TruckID / outlimits=Deflim nochart; run;
The OUTLIMITS= option names the data set containing the control limits, and the NOCHART option suppresses the display of the chart. Options such as OUTLIMITS= and NOCHART are specified after the slash (/) in the CCHART statement. A complete list of options is presented in the section Syntax. The data set Deflim is listed in Figure 13.7.6.
The data set Deflim contains one observation with the limits for the process Defects. The variables _LCLC_, and _UCLC_ contain the lower and upper control limits. The variable _C_ contains the central line, and the variable _U_ contains the average number of nonconformities per inspection unit. Since all the subgroups contain a single inspection unit, the values of _C_ and _U_ are the same. The value of _LIMITN_ is the nominal sample size associated with the control limits, and the value of _SIGMAS_ is the multiple of associated with the control limits. The variables _VAR_ and _SUBGRP_ are bookkeeping variables that save the process and subgroup-variable. The variable _TYPE_ is a bookkeeping variable that indicates whether the value of _U_ is an estimate or standard value. For more information, see the section OUTLIMITS= Data Set.
Alternatively, you can use the OUTTABLE= option to create an output data set that saves both the control limits and the subgroup statistics, as illustrated by the following statements:
title 'Number of Nonconformities and Control Limit Information'; proc shewhart data=Trucks; cchart Defects*TruckID / outtable=Trucktab nochart; run;
The OUTTABLE= data set Trucktab is listed in Figure 13.7.7.
Number of Nonconformities and Control Limit Information |
_VAR_ | TruckID | _SIGMAS_ | _LIMITN_ | _SUBN_ | _LCLC_ | _SUBC_ | _C_ | _UCLC_ | _EXLIM_ |
---|---|---|---|---|---|---|---|---|---|
Defects | C1 | 3 | 1 | 1 | 0 | 5 | 7.8 | 16.1785 | |
Defects | C2 | 3 | 1 | 1 | 0 | 4 | 7.8 | 16.1785 | |
Defects | C3 | 3 | 1 | 1 | 0 | 4 | 7.8 | 16.1785 | |
Defects | C4 | 3 | 1 | 1 | 0 | 8 | 7.8 | 16.1785 | |
Defects | C5 | 3 | 1 | 1 | 0 | 7 | 7.8 | 16.1785 | |
Defects | C6 | 3 | 1 | 1 | 0 | 12 | 7.8 | 16.1785 | |
Defects | C7 | 3 | 1 | 1 | 0 | 3 | 7.8 | 16.1785 | |
Defects | C8 | 3 | 1 | 1 | 0 | 11 | 7.8 | 16.1785 | |
Defects | E4 | 3 | 1 | 1 | 0 | 8 | 7.8 | 16.1785 | |
Defects | E9 | 3 | 1 | 1 | 0 | 4 | 7.8 | 16.1785 | |
Defects | E7 | 3 | 1 | 1 | 0 | 9 | 7.8 | 16.1785 | |
Defects | E6 | 3 | 1 | 1 | 0 | 13 | 7.8 | 16.1785 | |
Defects | A3 | 3 | 1 | 1 | 0 | 5 | 7.8 | 16.1785 | |
Defects | A4 | 3 | 1 | 1 | 0 | 4 | 7.8 | 16.1785 | |
Defects | A7 | 3 | 1 | 1 | 0 | 9 | 7.8 | 16.1785 | |
Defects | Q1 | 3 | 1 | 1 | 0 | 15 | 7.8 | 16.1785 | |
Defects | Q2 | 3 | 1 | 1 | 0 | 8 | 7.8 | 16.1785 | |
Defects | Q3 | 3 | 1 | 1 | 0 | 9 | 7.8 | 16.1785 | |
Defects | Q9 | 3 | 1 | 1 | 0 | 10 | 7.8 | 16.1785 | |
Defects | Q4 | 3 | 1 | 1 | 0 | 8 | 7.8 | 16.1785 |
This data set contains one observation for each subgroup sample. The variables _SUBC_ and _SUBN_ contain the number of nonconformities per subgroup and the number of inspection units per subgroup. The variables _LCLC_ and _UCLC_ contain the lower and upper control limits, and the variable _C_ contains the central line. The variables _VAR_ and TruckID contain the process name and values of the subgroup-variable, respectively. For more information, see OUTTABLE= Data Set.
An OUTTABLE= data set can be read later as a TABLE= data set in the SHEWHART procedure. For example, the following statements read Trucktab and display a chart (not shown here) identical to the chart in Figure 13.7.5:
title 'c Chart for Paint Defects in New Trucks'; proc shewhart table=Trucktab; cchart Defects*Truckid; label _SUBC_ = 'Number of Paint Defects'; run;
Because the SHEWHART procedure simply displays the information in a TABLE= data set, you can use TABLE= data sets to create specialized control charts (see Specialized Control Charts). For more information, see TABLE= Data Set.
Copyright © SAS Institute, Inc. All Rights Reserved.