Note: See Box Chart Examples in the SAS/QC Sample Library.
You can save the control limits for a box 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 Turbine
(see Creating Box Charts from Raw Data) and save the control limits displayed in Figure 17.4 in a data set named TURBLIM:
proc shewhart data=Turbine; boxchart KWatts*Day / outlimits=Turblim nochart; run;
The OUTLIMITS= option names the data set containing the control limits, and the NOCHART option suppresses the display of the
chart. The data set Turblim
is listed in Figure 17.10.
The data set Turblim
contains one observation with the limits for process KWatts
. The variables _LCLX_
and _UCLX_
contain the lower and upper control limits for the means, 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 . 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.
The variables _LCLS_
, _S_
, and _UCLS_
are not used to create box charts, but they are included so that the data set Turblim
can be used to create an s chart; see XSCHART Statement: SHEWHART Procedure. If you specify the RANGES option in the BOXCHART statement, the variables _LCLR_
, _R_
, and _UCLR_
, rather than the variables _LCLS_
, _S_
, and _UCLS_
, are included in the OUTLIMITS= data set. These variables can be used to create an R chart; see XRCHART Statement: SHEWHART Procedure.
If you specify CONTROLSTAT=MEDIAN to request control limits for medians, the variables _LCLM_
and _UCLM_
, rather than the variables _LCLX_
and _UCLX_
, are included in the OUTLIMITS= data set as demonstrated by the following statements:
proc shewhart data=Turbine; boxchart KWatts*Day / outlimits = Turblim2 controlstat = median nochart; run;
Turblim2
is listed in Figure 17.11. 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:
title 'Summary Statistics and Control Limit Information'; proc shewhart data=Turbine; boxchart KWatts*Day / outtable=Turbtab nochart; run;
The data set Turbtab
is partially listed in Figure 17.12.
Figure 17.12: The OUTTABLE= Data Set Turbtab
Summary Statistics and Control Limit Information |
_VAR_ | Day | _SIGMAS_ | _LIMITN_ | _SUBN_ | _LCLX_ | _SUBX_ | _MEAN_ | _UCLX_ | _STDDEV_ | _EXLIM_ | _SUBMIN_ | _SUBQ1_ | _SUBMED_ | _SUBQ3_ | _SUBMAX_ |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
KWatts | 04JUL | 3 | 20 | 20 | 3351.92 | 3487.40 | 3485.41 | 3618.90 | 198.996 | 3180 | 3340.0 | 3490.0 | 3610.0 | 4050 | |
KWatts | 05JUL | 3 | 20 | 20 | 3351.92 | 3471.65 | 3485.41 | 3618.90 | 198.996 | 3179 | 3333.5 | 3419.5 | 3605.0 | 3849 | |
KWatts | 06JUL | 3 | 20 | 20 | 3351.92 | 3488.30 | 3485.41 | 3618.90 | 198.996 | 3304 | 3376.0 | 3456.5 | 3604.5 | 3781 | |
KWatts | 07JUL | 3 | 20 | 20 | 3351.92 | 3434.20 | 3485.41 | 3618.90 | 198.996 | 3045 | 3390.5 | 3447.0 | 3550.0 | 3629 | |
KWatts | 08JUL | 3 | 20 | 20 | 3351.92 | 3475.80 | 3485.41 | 3618.90 | 198.996 | 2968 | 3321.0 | 3487.0 | 3611.5 | 3916 | |
KWatts | 09JUL | 3 | 20 | 20 | 3351.92 | 3518.10 | 3485.41 | 3618.90 | 198.996 | 3047 | 3425.5 | 3576.0 | 3615.0 | 3881 | |
KWatts | 10JUL | 3 | 20 | 20 | 3351.92 | 3492.65 | 3485.41 | 3618.90 | 198.996 | 3002 | 3368.5 | 3495.5 | 3621.5 | 3787 | |
KWatts | 11JUL | 3 | 20 | 20 | 3351.92 | 3496.40 | 3485.41 | 3618.90 | 198.996 | 3196 | 3346.0 | 3473.5 | 3592.5 | 3994 | |
KWatts | 12JUL | 3 | 20 | 20 | 3351.92 | 3398.50 | 3485.41 | 3618.90 | 198.996 | 3115 | 3188.5 | 3426.0 | 3568.5 | 3731 | |
KWatts | 13JUL | 3 | 20 | 20 | 3351.92 | 3456.05 | 3485.41 | 3618.90 | 198.996 | 3263 | 3340.0 | 3444.0 | 3505.5 | 4040 | |
KWatts | 14JUL | 3 | 20 | 20 | 3351.92 | 3493.60 | 3485.41 | 3618.90 | 198.996 | 3215 | 3336.0 | 3441.5 | 3616.0 | 3872 | |
KWatts | 15JUL | 3 | 20 | 20 | 3351.92 | 3563.30 | 3485.41 | 3618.90 | 198.996 | 3182 | 3409.5 | 3561.0 | 3719.5 | 3850 | |
KWatts | 16JUL | 3 | 20 | 20 | 3351.92 | 3519.05 | 3485.41 | 3618.90 | 198.996 | 3212 | 3378.0 | 3515.0 | 3682.5 | 3769 | |
KWatts | 17JUL | 3 | 20 | 20 | 3351.92 | 3474.20 | 3485.41 | 3618.90 | 198.996 | 3077 | 3329.0 | 3501.5 | 3599.5 | 3812 | |
KWatts | 18JUL | 3 | 20 | 20 | 3351.92 | 3443.60 | 3485.41 | 3618.90 | 198.996 | 3061 | 3315.5 | 3435.0 | 3614.5 | 3815 | |
KWatts | 19JUL | 3 | 20 | 20 | 3351.92 | 3586.35 | 3485.41 | 3618.90 | 198.996 | 3288 | 3426.5 | 3546.0 | 3762.5 | 3877 | |
KWatts | 20JUL | 3 | 20 | 20 | 3351.92 | 3486.45 | 3485.41 | 3618.90 | 198.996 | 3114 | 3373.0 | 3474.5 | 3635.5 | 3928 | |
KWatts | 21JUL | 3 | 20 | 20 | 3351.92 | 3492.90 | 3485.41 | 3618.90 | 198.996 | 3167 | 3400.5 | 3488.0 | 3582.5 | 3801 | |
KWatts | 22JUL | 3 | 20 | 20 | 3351.92 | 3432.80 | 3485.41 | 3618.90 | 198.996 | 3056 | 3322.0 | 3460.0 | 3561.0 | 3800 | |
KWatts | 23JUL | 3 | 20 | 20 | 3351.92 | 3496.90 | 3485.41 | 3618.90 | 198.996 | 3145 | 3308.5 | 3495.0 | 3652.0 | 3917 |
This data set contains one observation for each subgroup sample. The variable _SUBMIN_
contains the subgroup minimums, and the variable _SUBQ1_
contains the first quartile for each subgroup. The variable _SUBX_
contains the subgroup means, and the variable _SUBMED_
contains the subgroup medians. The variable _SUBQ3_
contains the third quartiles, and the variable _SUBMAX_
contains the subgroup maximums. The variable _SUBN_
contains the subgroup sample sizes. The variables _LCLX_
and _UCLX_
contain the lower and upper control limits for the means. The variable _MEAN_
contains the central line. The variables _VAR_
and Day
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 Turbtab
and display a box chart (not shown here) that is identical to the chart in Figure 17.4:
title 'Box Chart for Power Output'; proc shewhart table=Turbtab; boxchart KWatts*Day; label _SUBX_ = 'Average Power Output'; 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.