Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
XRCHART Statement

Creating Charts for Means and Ranges from Summary Data

See SHWXR1 in the SAS/QC Sample Library

The previous example illustrates how you can create \bar{X}and R charts using raw data (process measurements). However, in many applications, the data are provided as subgroup means and ranges. This example illustrates how you can use the XRCHART statement with data of this type.

The following data set (WAFERSUM) provides the data from the preceding example in summarized form:

   data wafersum;
      input batch diamtrx diamtrr;
      diamtrn = 5;
   datalines;
    1  34.992  0.02
    2  34.994  0.03
    3  34.998  0.01
    4  34.998  0.02
    5  34.992  0.02
    6  34.996  0.01
    7  34.996  0.03
    8  34.992  0.02
    9  34.992  0.03
   10  35.000  0.02
   11  34.996  0.03
   12  34.994  0.03
   13  34.992  0.03
   14  34.998  0.02
   15  34.988  0.02
   16  35.000  0.02
   17  34.984  0.01
   18  35.002  0.04
   19  34.988  0.02
   20  34.994  0.01
   21  34.992  0.02
   22  35.002  0.01
   23  35.004  0.04
   24  34.996  0.03
   25  34.994  0.01
   ;

A listing of the data set WAFERSUM is shown in Figure 43.3.

 
Summary Data Set for Wafer Diameters

batch diamtrx diamtrr diamtrn
1 34.992 0.02 5
2 34.994 0.03 5
3 34.998 0.01 5
4 34.998 0.02 5
5 34.992 0.02 5
6 34.996 0.01 5
7 34.996 0.03 5
8 34.992 0.02 5
9 34.992 0.03 5
10 35.000 0.02 5
11 34.996 0.03 5
12 34.994 0.03 5
13 34.992 0.03 5
14 34.998 0.02 5
15 34.988 0.02 5
16 35.000 0.02 5
17 34.984 0.01 5
18 35.002 0.04 5
19 34.988 0.02 5
20 34.994 0.01 5
21 34.992 0.02 5
22 35.002 0.01 5
23 35.004 0.04 5
24 34.996 0.03 5
25 34.994 0.01 5
Figure 43.3: The Summary Data Set WAFERSUM

In this data set, there is exactly one observation for each subgroup (note that the subgroups are still indexed by BATCH). The variable DIAMTRX contains the subgroup means, the variable DIAMTRR contains the subgroup ranges, and the variable DIAMTRN contains the subgroup sample sizes (these are all equal to five).

You can read this data set by specifying it as a HISTORY= data set in the PROC SHEWHART statement, as follows:

   title 'Mean and Range Charts for Diameters';
   proc shewhart history=wafersum lineprinter;
      xrchart diamtr*batch='*';
   run;

The charts are shown in Figure 43.4. Since the LINEPRINTER option is specified in the PROC SHEWHART statement, line printer output is produced. * The asterisk (*) specified in single quotes after the subgroup-variable indicates the character used to plot the points. This character must follow an equal sign.

Note that DIAMTR is not the name of a SAS variable in the data set WAFERSUM but is, instead, the common prefix for the names of the three SAS variables DIAMTRX, DIAMTRR, and DIAMTRN. The suffix characters X, R, and N indicate mean, range, and sample size, respectively. Thus, you can specify three subgroup summary variables in the HISTORY= data set with a single name (DIAMTR), which is referred to as the process. The name BATCH specified after the asterisk is the name of the subgroup-variable.

 
Mean and Range Charts for Diameters

                                                                 3 Sigma Limits 
                                                                 For n=5:       
M         -----------------------------------------------------                 
e 35.010 +                                                     |                
a        |=====================================================| UCL = 35.0077  
n 35.005 +                                             +*      |                
         |                                    *       *  +     |                
o 35.000 +                    *           *   +       +  +     |                
f        |     +*+*          + +      *   +  + +     +    +    | =              
  34.995 +---+*----+-+*+*+---+--*+*+-+-+-+-+-+-+--*+-+----*+*--| X = 34.9950    
d        |  *       *     *+*       *  + + + + + +  *          |                
i 34.990 +                              +  + +  ++             |                
a        |                              *   +   *              |                
m 34.985 +                                  *                  |                
t        |=====================================================| LCL = 34.9823  
r 34.980 +                                                     |                
          +---+---+---+---+---+---+---+---+---+---+---+---+---+                 
          -----------------------------------------------------                 
    0.05 +=====================================================| UCL = .047     
R   0.04 +                                    *         *+     |                
a   0.03 +   +*         *+ +*+ +*+*+*+       + +       +  *    | -              
n   0.02 +--*--+-+*+*+-+--*---*-------*+*+*+-+--*+-+*+-+---+---| R = .022       
g   0.01 +      *     *                     *     *   *     *  |                
e      0 +=====================================================| LCL = 0        
          +---+---+---+---+---+---+---+---+---+---+---+---+---+                 
          0   2   4   6   8  10  12  14  16  18  20  22  24  26                 
                                                                                
                         Subgroup Index (batch)                                 
                                                                                
Subgroup Sizes:  * n=5                                                          
Figure 43.4: \bar{X} and R Charts from Summary Data

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


Furthermore, the names of the subgroup mean, range, and sample size variables must begin with the process name specified in the XRCHART statement and end with the special suffix characters X, R, and N, respectively. If the names do not follow this convention, you can use the RENAME option to rename the variables for the duration of the SHEWHART procedure step. Suppose that, instead of the variables DIAMTRX, DIAMTRR, and DIAMTRN, the data set WAFERSUM contained summary variables named MEANS, RANGES, and SIZES. The following statements would temporarily rename MEANS, RANGES, and SIZES to DIAMTRX, DIAMTRR, and DIAMTRN, respectively:

   proc shewhart
      history=wafersum (rename=(means  = diamtrx
                                ranges = diamtrr
                                sizes  = diamtrn ));
      xrchart diamtr*batch='*';
   run;

In summary, the interpretation of process depends on the input data set:


For more information, see "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.