Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
XCHART Statement

Creating a V-Mask Cusum Chart from Raw Data

See CUSTWOS1 in the SAS/QC Sample Library

A machine fills eight-ounce cans of two-cycle engine oil additive. The filling process is believed to be in statistical control, and the process is set so that the average weight of a filled can is \mu_{0}=8.100 ounces. Previous analysis shows that the standard deviation of fill weights is \sigma_{0}=0.050 ounces. A two-sided cusum chart is used to detect shifts of at least one standard deviation in either the positive or negative direction from the target mean of 8.100 ounces.

Subgroup samples of four cans are selected every hour for twelve hours. The cans are weighed, and their weights are saved in a SAS data set named OIL.

   data oil;
      label hour = 'Hour';
      input hour @;
      do i=1 to 4;
         input weight @;
         output;
         end;
      drop i;
      datalines;
    1  8.024  8.135  8.151  8.065
    2  7.971  8.165  8.077  8.157
    3  8.125  8.031  8.198  8.050
    4  8.123  8.107  8.154  8.095
    5  8.068  8.093  8.116  8.128
    6  8.177  8.011  8.102  8.030
    7  8.129  8.060  8.125  8.144
    8  8.072  8.010  8.097  8.153
    9  8.066  8.067  8.055  8.059
   10  8.089  8.064  8.170  8.086
   11  8.058  8.098  8.114  8.156
   12  8.147  8.116  8.116  8.018
   ;

   proc print noobs;
      run;

The data set OIL is listed in Figure 12.1.

 
hour weight
1 8.024
1 8.135
1 8.151
1 8.065
2 7.971
2 8.165
2 8.077
2 8.157
3 8.125
3 8.031
3 8.198
3 8.050
4 8.123
4 8.107
4 8.154
4 8.095
5 8.068
5 8.093
5 8.116
5 8.128
6 8.177
6 8.011
6 8.102
6 8.030
7 8.129
7 8.060
7 8.125
7 8.144
8 8.072
8 8.010
8 8.097
8 8.153
9 8.066
9 8.067
9 8.055
9 8.059
10 8.089
10 8.064
10 8.170
10 8.086
11 8.058
11 8.098
11 8.114
11 8.156
12 8.147
12 8.116
12 8.116
12 8.018
Figure 12.1: Partial Listing of the Data Set OIL

Each observation contains one value of WEIGHT along with its associated value of HOUR, and the values of HOUR are in increasing order. The CUSUM procedure assumes that DATA= input data sets are sorted in this "strung-out" form.

The following statements request a two-sided cusum chart with a V-mask for the average weights:

   symbol v=dot c=salmon;
   title 'Cusum Chart for Average Weights of Cans';
   proc cusum data=oil;
      xchart weight*hour /
         mu0     = 8.100           /* Target mean for process  */
         sigma0  = 0.050           /* Known standard deviation */
         delta   = 1               /* Shift to be detected     */
         alpha   = 0.10            /* Type I error probability */
         vaxis   = -5 to 3 
         cinfill = ywh
         climits = salmon
         cframe  = bigb
         cmask   = black;
      label weight = 'Cumulative Sum';
   run;

The CUSUM procedure is invoked with the PROC CUSUM statement. The DATA= option in the PROC CUSUM statement specifies that the SAS data set OIL is to be read. The variables to be analyzed are specified in the XCHART statement. The process measurement variable (WEIGHT) is specified before the asterisk (this variable is referred to more generally as a process). The time variable (HOUR) is specified after the asterisk (this variable is referred to more generally as a subgroup-variable because it determines how the measurements are classified into rational subgroups).

The option ALPHA=0.10 specifies the probability of a Type 1 error for the cusum scheme (the probability of detecting a shift when none occurs).

The cusum chart is shown in Figure 12.2.

cusxgs1.gif (4267 bytes)

Figure 12.2: Two-Sided Cusum Chart with V-Mask

The cusum S1 plotted at HOUR=1 is simply the standardized deviation of the first subgroup mean from the target mean.

S_{1}= \frac{8.09375-8.100}{0.050/\sqrt{4}} = -0.250
The cusum S2 plotted at HOUR=2 is S1 plus the standardized deviation of the second subgroup mean from the target mean.
S_{2}= S_{1}+ \frac{8.0925- 8.100}{0.050/\sqrt{4}}
 = -0.550
In general, the cusum plotted at HOUR=t is St-1 plus the standardized deviation of the t th subgroup mean from the target mean.
S_{t} = S_{t-1} + \frac{\bar{X}_{t} - \mu_{0} }{\sigma_{0} / \sqrt{n}}
For further details, see "Two-Sided Cusum Schemes" .

You can interpret the chart by comparing the points with the V-mask whose right edge is centered at the most recent point (HOUR=12). Since none of the points cross the arms of the V-mask, there is no evidence that a shift has occurred, and the fluctuations in the cusums can be attributed to chance variation. In general, crossing the lower arm is evidence of an increase in the process mean, whereas crossing the upper arm is evidence of a decrease in the mean.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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