Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
MCHART Statement

Creating Charts for Medians from Raw Data

See SHWMCHR in the SAS/QC Sample Library

A consumer products company weighs detergent boxes (in pounds) to determine whether the fill process is in control. The following statements create a SAS data set named DETERGNT, which contains the weights for five boxes in each of 28 lots. A lot is considered a rational subgroup.

   data detergnt;
      input lot @;
      do i=1 to 5;
         input weight @;
         output;
      end;
   drop i;
   datalines;
    1 17.39 26.93 19.34 22.56 24.49
    2 23.63 23.57 23.54 20.56 22.17
    3 24.35 24.58 23.79 26.20 21.55
    4 25.52 28.02 28.44 25.07 23.39
    5 23.25 21.76 29.80 23.09 23.70
    6 23.01 22.67 24.70 20.02 26.35
    7 23.86 24.19 24.61 26.05 24.18
    8 26.00 26.82 28.03 26.27 25.85
    9 21.58 22.31 25.03 20.86 26.94
   10 22.64 21.05 22.66 29.26 25.02
   11 26.38 27.50 23.91 26.80 22.53
   12 23.01 23.71 25.26 20.21 22.38
   13 23.15 23.53 22.98 21.62 26.99
   14 26.83 23.14 24.73 24.57 28.09
   15 26.15 26.13 20.57 25.86 24.70
   16 25.81 23.22 23.99 23.91 27.57
   17 25.53 22.87 25.22 24.30 20.29
   18 24.88 24.15 25.29 29.02 24.46
   19 22.32 25.96 29.54 25.92 23.44
   20 25.63 26.83 20.95 24.80 27.25
   21 21.68 21.11 26.07 25.17 27.63
   22 26.72 27.05 24.90 30.08 25.22
   23 31.58 22.41 23.67 23.47 24.90
   24 28.06 23.44 24.92 24.64 27.42
   25 21.10 22.34 24.96 26.50 24.51
   26 23.80 24.03 24.75 24.82 27.21
   27 25.10 26.09 27.21 24.28 22.45
   28 25.53 22.79 26.26 25.85 25.64
   ;

A listing of DETERGNT is shown in Figure 35.1.

 
The Data Set DETERGNT

lot weight
1 17.39
1 26.93
1 19.34
1 22.56
1 24.49
2 23.63
2 23.57
2 23.54
2 20.56
2 22.17
3 24.35
3 24.58
3 23.79
3 26.20
3 21.55
4 25.52
4 28.02
4 28.44
4 25.07
4 23.39
5 23.25
5 21.76
5 29.80
5 23.09
5 23.70
6 23.01
6 22.67
6 24.70
6 20.02
6 26.35
7 23.86
7 24.19
7 24.61
7 26.05
7 24.18
8 26.00
8 26.82
8 28.03
8 26.27
8 25.85
9 21.58
9 22.31
9 25.03
9 20.86
9 26.94
10 22.64
10 21.05
10 22.66
10 29.26
10 25.02
11 26.38
11 27.50
11 23.91
11 26.80
11 22.53
12 23.01
12 23.71
12 25.26
12 20.21
12 22.38
13 23.15
13 23.53
13 22.98
13 21.62
13 26.99
14 26.83
14 23.14
14 24.73
14 24.57
14 28.09
15 26.15
15 26.13
15 20.57
15 25.86
15 24.70
16 25.81
16 23.22
16 23.99
16 23.91
16 27.57
17 25.53
17 22.87
17 25.22
17 24.30
17 20.29
18 24.88
18 24.15
18 25.29
18 29.02
18 24.46
19 22.32
19 25.96
19 29.54
19 25.92
19 23.44
20 25.63
20 26.83
20 20.95
20 24.80
20 27.25
21 21.68
21 21.11
21 26.07
21 25.17
21 27.63
22 26.72
22 27.05
22 24.90
22 30.08
22 25.22
23 31.58
23 22.41
23 23.67
23 23.47
23 24.90
24 28.06
24 23.44
24 24.92
24 24.64
24 27.42
25 21.10
25 22.34
25 24.96
25 26.50
25 24.51
26 23.80
26 24.03
26 24.75
26 24.82
26 27.21
27 25.10
27 26.09
27 27.21
27 24.28
27 22.45
28 25.53
28 22.79
28 26.26
28 25.85
28 25.64
Figure 35.1: Listing of the Data Set DETERGNT

The data set DETERGNT is said to be in "strung-out" form, since each observation contains the lot number and weight of a single box. The first five observations contain the weights for the first lot, the second five observations contain the weights for the second lot, and so on. Because the variable LOT classifies the observations into rational subgroups, it is referred to as the subgroup-variable. The variable WEIGHT contains the weights and is referred to as the process variable (or process for short).

The within-subgroup variability of the weights is known to be stable. You can use a median chart to determine whether the mean level of the weights is in control. The following statements create the median chart shown in Figure 35.2:

   title 'Median Chart for Detergent Box Weight';
   symbol v=dot c=yellow;
   proc shewhart data=detergnt;
      mchart weight*lot / cframe   = viv
                          cinfill  = vpav
                          cconnect = yellow;
   run;

This example illustrates the basic form of the MCHART statement. After the keyword MCHART, you specify the process to analyze (in this case, WEIGHT) followed by an asterisk and the subgroup-variable (LOT).

The input data set is specified with the DATA= option in the PROC SHEWHART statement.

mgs2.gif (5436 bytes)

Figure 35.2: Median Chart for Detergent Box Weight Data

Each point on the chart represents the median of the weights for a particular lot. For instance, the weights for the first lot are 17.39, 19.34, 22.56, 24.49, and 26.93, and consequently, the median plotted for this lot is 22.56.

Since all of the subgroup medians lie within the control limits, you can conclude that the process is in statistical control. By default, the control limits shown are 3\sigma limits estimated from the data; the formulas for the limits are given in Table 35.22. You can also read control limits from an input data set; see "Reading Preestablished Control Limits" .

For computational details, see "Constructing Median Charts" . For more details on reading raw measurements, see "DATA= Data Set" .

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.