MCHART Statement: SHEWHART Procedure

Saving Summary Statistics

Note: See Median Chart Examples in the SAS/QC Sample Library.

In this example, the MCHART statement is used to create a summary data set that can be read later by the SHEWHART procedure (as in the preceding example). The following statements read measurements from the data set Detergent and create a summary data set named Dethist:

proc shewhart data=Detergent;
   mchart Weight*Lot / outhistory = Dethist
                       nochart;
run;

The OUTHISTORY= option names the output data set, and the NOCHART option suppresses the display of the chart, which would be identical to the chart in Figure 17.34. Figure 17.37 contains a partial listing of Dethist.

Figure 17.37: The Summary Data Set Dethist

Summary Data Set DETHIST for Detergent Box Weights

Lot WeightM WeightR WeightN
1 22.56 9.54 5
2 23.54 3.07 5
3 24.35 4.65 5
4 25.52 5.05 5
5 23.25 8.04 5
6 23.01 6.33 5
7 24.19 2.19 5
8 26.27 2.18 5
9 22.31 6.08 5
10 22.66 8.21 5
11 26.38 4.97 5
12 23.01 5.05 5
13 23.15 5.37 5
14 24.73 4.95 5
15 25.86 5.58 5
16 23.99 4.35 5
17 24.30 5.24 5
18 24.88 4.87 5
19 25.92 7.22 5
20 25.63 6.30 5
21 25.17 6.52 5
22 26.72 5.18 5
23 23.67 9.17 5
24 24.92 4.62 5
25 24.51 5.40 5
26 24.75 3.41 5
27 25.10 4.76 5
28 25.64 3.47 5


There are four variables in the data set Dethist.

  • Lot contains the subgroup index.

  • WeightM contains the subgroup medians.

  • WeightR contains the subgroup ranges.

  • WeightN contains the subgroup sample sizes.

Note that the summary statistic variables are named by adding the suffix characters M, R, and N to the process Weight specified in the MCHART statement. In other words, the variable naming convention for OUTHISTORY= data sets is the same as that for HISTORY= data sets.

If you specify the STDDEVIATIONS option, the OUTHISTORY= data set includes a subgroup standard deviation variable instead of a subgroup range variable, as demonstrated by the following statements:

proc shewhart data=Detergent;
   mchart Weight*Lot / outhistory = Dethist2
                       stddeviations
                       nochart;
run;

Figure 17.38 contains a partial listing of Dethist2.

Figure 17.38: The Summary Data Set Dethist2

Summary Data Set with Subgroup Standard Deviations

Lot WeightM WeightS WeightN
1 22.56 3.84205 5
2 23.54 1.34050 5
3 24.35 1.68087 5
4 25.52 2.11558 5
5 23.25 3.14747 5
6 23.01 2.37115 5
7 24.19 0.86491 5
8 26.27 0.88382 5
9 22.31 2.55563 5
10 22.66 3.20064 5
11 26.38 2.10858 5
12 23.01 1.85360 5
13 23.15 1.99936 5
14 24.73 1.96853 5
15 25.86 2.37425 5
16 23.99 1.77395 5
17 24.30 2.14006 5
18 24.88 1.98148 5
19 25.92 2.78591 5
20 25.63 2.51040 5
21 25.17 2.82905 5
22 26.72 2.05752 5
23 23.67 3.67124 5
24 24.92 1.96007 5
25 24.51 2.15219 5
26 24.75 1.35365 5
27 25.10 1.80968 5
28 25.64 1.38345 5


The variable WeightS, which contains the subgroup standard deviations, is named by adding the suffix character S to the process Weight.

For more information, see OUTHISTORY= Data Set.