MCHART Statement: SHEWHART Procedure

Saving Control Limits

See SHWMCHR in the SAS/QC Sample LibraryYou can save the control limits for a median chart in a SAS data set; this enables you to apply the control limits to future data (see Reading Preestablished Control Limits) or modify the limits with a DATA step program.

The following statements read measurements from the data set Detergent (see Creating Charts for Medians from Raw Data) and save the control limits displayed in Figure 17.34 in a data set named Detlim:

proc shewhart data=Detergent;
   mchart Weight*Lot / outlimits=Detlim
                       nochart;
run;

The OUTLIMITS= option names the data set containing the control limits, and the NOCHART option suppresses the display of the charts. The data set Detlim is listed in Figure 17.39.

Figure 17.39: The Data Set Detlim Containing Control Limit Information

Control Limits for Detergent Box Weights

_VAR_ _SUBGRP_ _TYPE_ _LIMITN_ _ALPHA_ _SIGMAS_ _LCLM_ _MEAN_ _UCLM_ _LCLR_ _R_ _UCLR_ _STDDEV_
Weight Lot ESTIMATE 5 .002909021 3 20.7554 24.4996 28.2439 0 5.42036 11.4613 2.33041


The data set Detlim contains one observation with the limits for the process Weight. The variables _LCLM_ and _UCLM_ contain the lower and upper control limits for the medians, and the variable _MEAN_ contains the central line. The value of _MEAN_ is an estimate of the process mean, and the value of _STDDEV_ is an estimate of the process standard deviation $\sigma $. The value of _LIMITN_ is the nominal sample size associated with the control limits, and the value of _SIGMAS_ is the multiple of $\sigma $ 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 values of _MEAN_ and _STDDEV_ are estimates or standard values.

The variables _LCLR_, _R_, and _UCLR_ are not used to create median charts, but they are included so the data set Detlim can be used to create an R chart; see MRCHART Statement: SHEWHART Procedure and RCHART Statement: SHEWHART Procedure. If you specify the STDDEVIATIONS option in the MCHART statement, the variables _LCLS_, _S_, and _UCLS_ are included in the OUTLIMITS= data set. These variables can be used to create an s chart; see SCHART Statement: SHEWHART Procedure. For more information, see OUTLIMITS= Data Set.

You can create an output data set containing both control limits and summary statistics with the OUTTABLE= option, as illustrated by the following statements:

proc shewhart data=Detergent;
   mchart Weight*Lot / outtable=Dtable
                       nochart;
run;

The data set Dtable is listed in Figure 17.40.

Figure 17.40: The Data Set Dtable

Summary Statistics and Control Limit Information

_VAR_ Lot _SIGMAS_ _LIMITN_ _SUBN_ _LCLM_ _SUBMED_ _MEAN_ _UCLM_ _STDDEV_ _EXLIM_
Weight 1 3 5 5 20.7554 22.56 24.4996 28.2439 2.33041  
Weight 2 3 5 5 20.7554 23.54 24.4996 28.2439 2.33041  
Weight 3 3 5 5 20.7554 24.35 24.4996 28.2439 2.33041  
Weight 4 3 5 5 20.7554 25.52 24.4996 28.2439 2.33041  
Weight 5 3 5 5 20.7554 23.25 24.4996 28.2439 2.33041  
Weight 6 3 5 5 20.7554 23.01 24.4996 28.2439 2.33041  
Weight 7 3 5 5 20.7554 24.19 24.4996 28.2439 2.33041  
Weight 8 3 5 5 20.7554 26.27 24.4996 28.2439 2.33041  
Weight 9 3 5 5 20.7554 22.31 24.4996 28.2439 2.33041  
Weight 10 3 5 5 20.7554 22.66 24.4996 28.2439 2.33041  
Weight 11 3 5 5 20.7554 26.38 24.4996 28.2439 2.33041  
Weight 12 3 5 5 20.7554 23.01 24.4996 28.2439 2.33041  
Weight 13 3 5 5 20.7554 23.15 24.4996 28.2439 2.33041  
Weight 14 3 5 5 20.7554 24.73 24.4996 28.2439 2.33041  
Weight 15 3 5 5 20.7554 25.86 24.4996 28.2439 2.33041  
Weight 16 3 5 5 20.7554 23.99 24.4996 28.2439 2.33041  
Weight 17 3 5 5 20.7554 24.30 24.4996 28.2439 2.33041  
Weight 18 3 5 5 20.7554 24.88 24.4996 28.2439 2.33041  
Weight 19 3 5 5 20.7554 25.92 24.4996 28.2439 2.33041  
Weight 20 3 5 5 20.7554 25.63 24.4996 28.2439 2.33041  
Weight 21 3 5 5 20.7554 25.17 24.4996 28.2439 2.33041  
Weight 22 3 5 5 20.7554 26.72 24.4996 28.2439 2.33041  
Weight 23 3 5 5 20.7554 23.67 24.4996 28.2439 2.33041  
Weight 24 3 5 5 20.7554 24.92 24.4996 28.2439 2.33041  
Weight 25 3 5 5 20.7554 24.51 24.4996 28.2439 2.33041  
Weight 26 3 5 5 20.7554 24.75 24.4996 28.2439 2.33041  
Weight 27 3 5 5 20.7554 25.10 24.4996 28.2439 2.33041  
Weight 28 3 5 5 20.7554 25.64 24.4996 28.2439 2.33041  


This data set contains one observation for each subgroup sample. The variables _SUBMED_ and _SUBN_ contain the subgroup medians and subgroup sample sizes. The variables _LCLM_ and _UCLM_ contain the lower and upper control limits, and the variable _MEAN_ contains the central line. The variables _VAR_ and Lot 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. For example, the following statements read Dtable and display a median chart (not shown here) identical to the chart in Figure 17.34:

title 'Median Chart for Detergent Box Weight';
proc shewhart table=Dtable;
   mchart Weight*Lot;
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: SHEWHART Procedure). For more information, see TABLE= Data Set.