Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
XCHART Statement

Creating a V-Mask Cusum Chart from Subgroup Summary Data

See CUSTWOS1 in the SAS/QC Sample Library

The previous example illustrates how you can create a cusum chart using raw process measurements read from a DATA= data set. In many applications, however, the data are provided in summarized form as subgroup means. This example illustrates the use of the XCHART statement when the input data set is a HISTORY= data set.

The following data set provides the subgroup means, standard deviations, and sample sizes corresponding to the variable WEIGHT in the data set OIL (see "Creating a V-Mask Cusum Chart from Raw Data" ):

   data oilstat;
      input hour weightx weights weightn;
      datalines;
    1  8.0938  0.0596  4
    2  8.0925  0.0902  4
    3  8.1010  0.0763  4
    4  8.1198  0.0256  4
    5  8.1013  0.0265  4
    6  8.0800  0.0756  4
    7  8.1145  0.0372  4
    8  8.0830  0.0593  4
    9  8.0618  0.0057  4
   10  8.1023  0.0465  4
   11  8.1065  0.0405  4
   12  8.0993  0.0561  4
   ;
   proc print;
      run;

The data set OILSTAT is listed in Figure 12.3.

 
Obs hour weightx weights weightn
1 1 8.0938 0.0596 4
2 2 8.0925 0.0902 4
3 3 8.1010 0.0763 4
4 4 8.1198 0.0256 4
5 5 8.1013 0.0265 4
6 6 8.0800 0.0756 4
7 7 8.1145 0.0372 4
8 8 8.0830 0.0593 4
9 9 8.0618 0.0057 4
10 10 8.1023 0.0465 4
11 11 8.1065 0.0405 4
12 12 8.0993 0.0561 4
Figure 12.3: Listing of the Data Set OILSTAT

Since the data set contains a subgroup variable, a mean variable, a standard deviation variable, and a sample size variable, it can be read as a HISTORY= data set. Note that the names WEIGHTX, WEIGHTS, and WEIGHTN satisfy the naming conventions for summary variables since they begin with a common prefix (WEIGHT) and end with the suffix letters X, S, and N.

The following statements create the cusum chart:

   title 'Cusum Chart for Average Weights of Cans';

   proc cusum history=oilstat;
      xchart weight*hour /
         mu0    = 8.100           /* target mean              */
         sigma0 = 0.050           /* known standard deviation */
         delta  = 1               /* shift to be detected     */
         alpha  = 0.10            /* Type 1 error probability */
         vaxis  = -5 to 3 ;
      label weightx = 'Cumulative Sum';
   run;

Note that the process WEIGHT specified in the XCHART statement is the prefix of the summary variable names in PARTS. Also note that the vertical axis label is specified by associating a variable label with the subgroup mean variable (PARTGAPX). The horizontal axis label is specified by associating a variable label with the subgroup-variable (HOUR). The chart (not shown here) is identical to the one in Figure 12.2.

In general, a HISTORY= input data set used with the XRCHART statement must contain the following four variables:

Furthermore, the names of subgroup mean, standard deviation, and sample size variables must begin with the prefix process specified in the XRCHART statement and end with the special suffix characters X, S, and N, respectively.

Note that the interpretation of process depends on the input data set specified in the PROC CUSUM statement.

For more information, see "DATA= Data Set" and "HISTORY= Data Set" .

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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