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 18.35. Figure 18.38 contains a partial listing of Dethist.

Figure 18.38: 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 18.39 contains a partial listing of Dethist2.

Figure 18.39: The Summary Data Set Dethist2

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



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.