Note: See Median and Range Charts Examples in the SAS/QC Sample Library.
You can save the control limits for median and range charts 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 and Ranges from Raw Data) and save the control limits displayed in Figure 18.44 in a data set named Detlim
:
proc shewhart data=Detergent; mrchart 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 18.48.
Figure 18.48: The Data Set Detlim
Containing Control Limit Information
The data set Detlim
contains one observation with the limits for process Weight
. The variables _LCLM_
and _UCLM_
contain the control limits for the medians, and the variable _MEAN_
contains the central line. The variables _LCLR_
and _UCLR_
contain the control limits for the ranges, and the variable _R_
contains the central line. The values of _MEAN_
and _STDDEV_
are estimates of the process mean and process standard deviation . 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 values of _MEAN_
and _STDDEV_
are estimates or standard values. 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; mrchart Weight*Lot / outtable=Dtable nochart; run;
This data set contains one observation for each subgroup sample. The variables _SUBMED_
, _SUBR_
, and _SUBN_
contain the subgroup medians, subgroup ranges, and subgroup sample sizes. The variables _LCLM_
and _UCLM_
contain the control limits for the median chart, and the variables _LCLR_
and _UCLR_
contain the control limits for the range chart. The variable _MEAN_
contains the central line for the median chart, and the variable _R_
contains the central line for the range chart. The variables _VAR_
and Batch
contain the process name and values of the subgroup-variable, respectively. For more information, see OUTTABLE= Data Set.
The data set Dtable
is listed in Figure 18.49.
Figure 18.49: The Data Set Dtable
Summary Statistics and Control Limit Information |
_VAR_ | Lot | _SIGMAS_ | _LIMITN_ | _SUBN_ | _LCLM_ | _SUBMED_ | _MEAN_ | _UCLM_ | _STDDEV_ | _EXLIM_ | _LCLR_ | _SUBR_ | _R_ | _UCLR_ | _EXLIMR_ |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Weight | 1 | 3 | 5 | 5 | 20.7554 | 22.56 | 24.4996 | 28.2439 | 2.33041 | 0 | 9.54 | 5.42036 | 11.4613 | ||
Weight | 2 | 3 | 5 | 5 | 20.7554 | 23.54 | 24.4996 | 28.2439 | 2.33041 | 0 | 3.07 | 5.42036 | 11.4613 | ||
Weight | 3 | 3 | 5 | 5 | 20.7554 | 24.35 | 24.4996 | 28.2439 | 2.33041 | 0 | 4.65 | 5.42036 | 11.4613 | ||
Weight | 4 | 3 | 5 | 5 | 20.7554 | 25.52 | 24.4996 | 28.2439 | 2.33041 | 0 | 5.05 | 5.42036 | 11.4613 | ||
Weight | 5 | 3 | 5 | 5 | 20.7554 | 23.25 | 24.4996 | 28.2439 | 2.33041 | 0 | 8.04 | 5.42036 | 11.4613 | ||
Weight | 6 | 3 | 5 | 5 | 20.7554 | 23.01 | 24.4996 | 28.2439 | 2.33041 | 0 | 6.33 | 5.42036 | 11.4613 | ||
Weight | 7 | 3 | 5 | 5 | 20.7554 | 24.19 | 24.4996 | 28.2439 | 2.33041 | 0 | 2.19 | 5.42036 | 11.4613 | ||
Weight | 8 | 3 | 5 | 5 | 20.7554 | 26.27 | 24.4996 | 28.2439 | 2.33041 | 0 | 2.18 | 5.42036 | 11.4613 | ||
Weight | 9 | 3 | 5 | 5 | 20.7554 | 22.31 | 24.4996 | 28.2439 | 2.33041 | 0 | 6.08 | 5.42036 | 11.4613 | ||
Weight | 10 | 3 | 5 | 5 | 20.7554 | 22.66 | 24.4996 | 28.2439 | 2.33041 | 0 | 8.21 | 5.42036 | 11.4613 | ||
Weight | 11 | 3 | 5 | 5 | 20.7554 | 26.38 | 24.4996 | 28.2439 | 2.33041 | 0 | 4.97 | 5.42036 | 11.4613 | ||
Weight | 12 | 3 | 5 | 5 | 20.7554 | 23.01 | 24.4996 | 28.2439 | 2.33041 | 0 | 5.05 | 5.42036 | 11.4613 | ||
Weight | 13 | 3 | 5 | 5 | 20.7554 | 23.15 | 24.4996 | 28.2439 | 2.33041 | 0 | 5.37 | 5.42036 | 11.4613 | ||
Weight | 14 | 3 | 5 | 5 | 20.7554 | 24.73 | 24.4996 | 28.2439 | 2.33041 | 0 | 4.95 | 5.42036 | 11.4613 | ||
Weight | 15 | 3 | 5 | 5 | 20.7554 | 25.86 | 24.4996 | 28.2439 | 2.33041 | 0 | 5.58 | 5.42036 | 11.4613 | ||
Weight | 16 | 3 | 5 | 5 | 20.7554 | 23.99 | 24.4996 | 28.2439 | 2.33041 | 0 | 4.35 | 5.42036 | 11.4613 | ||
Weight | 17 | 3 | 5 | 5 | 20.7554 | 24.30 | 24.4996 | 28.2439 | 2.33041 | 0 | 5.24 | 5.42036 | 11.4613 | ||
Weight | 18 | 3 | 5 | 5 | 20.7554 | 24.88 | 24.4996 | 28.2439 | 2.33041 | 0 | 4.87 | 5.42036 | 11.4613 | ||
Weight | 19 | 3 | 5 | 5 | 20.7554 | 25.92 | 24.4996 | 28.2439 | 2.33041 | 0 | 7.22 | 5.42036 | 11.4613 | ||
Weight | 20 | 3 | 5 | 5 | 20.7554 | 25.63 | 24.4996 | 28.2439 | 2.33041 | 0 | 6.30 | 5.42036 | 11.4613 | ||
Weight | 21 | 3 | 5 | 5 | 20.7554 | 25.17 | 24.4996 | 28.2439 | 2.33041 | 0 | 6.52 | 5.42036 | 11.4613 | ||
Weight | 22 | 3 | 5 | 5 | 20.7554 | 26.72 | 24.4996 | 28.2439 | 2.33041 | 0 | 5.18 | 5.42036 | 11.4613 | ||
Weight | 23 | 3 | 5 | 5 | 20.7554 | 23.67 | 24.4996 | 28.2439 | 2.33041 | 0 | 9.17 | 5.42036 | 11.4613 | ||
Weight | 24 | 3 | 5 | 5 | 20.7554 | 24.92 | 24.4996 | 28.2439 | 2.33041 | 0 | 4.62 | 5.42036 | 11.4613 | ||
Weight | 25 | 3 | 5 | 5 | 20.7554 | 24.51 | 24.4996 | 28.2439 | 2.33041 | 0 | 5.40 | 5.42036 | 11.4613 | ||
Weight | 26 | 3 | 5 | 5 | 20.7554 | 24.75 | 24.4996 | 28.2439 | 2.33041 | 0 | 3.41 | 5.42036 | 11.4613 | ||
Weight | 27 | 3 | 5 | 5 | 20.7554 | 25.10 | 24.4996 | 28.2439 | 2.33041 | 0 | 4.76 | 5.42036 | 11.4613 | ||
Weight | 28 | 3 | 5 | 5 | 20.7554 | 25.64 | 24.4996 | 28.2439 | 2.33041 | 0 | 3.47 | 5.42036 | 11.4613 |
An OUTTABLE= data set can be read later as a TABLE=
data set. For example, the following statements read Dtable
and display charts (not shown here) identical to those in Figure 18.44:
title 'Median and Range Charts for Detergent Box Weight'; proc shewhart table=Dtable; mrchart 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.