Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
XSCHART Statement

Creating Charts for Means and Standard Deviations from Summary Data

See SHWXS1 in the SAS/QC Sample Library

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

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

   data oilsum;
      input day kwattsx kwattss kwattsn;
      informat day date7. ;
      format day date5. ;
      label day='Date of Measurement';
      datalines;
   04JUL94 3487.40 220.260 20
   05JUL94 3471.65 210.427 20
   06JUL94 3488.30 147.025 20
   07JUL94 3434.20 157.637 20
   08JUL94 3475.80 258.949 20
   09JUL94 3518.10 211.566 20
   10JUL94 3492.65 193.779 20
   11JUL94 3496.40 212.024 20
   12JUL94 3398.50 199.201 20
   13JUL94 3456.05 173.455 20
   14JUL94 3493.60 187.465 20
   15JUL94 3563.30 205.472 20
   16JUL94 3519.05 173.676 20
   17JUL94 3474.20 200.576 20
   18JUL94 3443.60 222.084 20
   19JUL94 3586.35 185.724 20
   20JUL94 3486.45 223.474 20
   21JUL94 3492.90 145.267 20
   22JUL94 3432.80 190.994 20
   23JUL94 3496.90 208.858 20
   ;

A listing of OILSUM is shown in Figure 44.3.

 
Summary Data Set for Power Output

day kwattsx kwattss kwattsn
04JUL 3487.40 220.260 20
05JUL 3471.65 210.427 20
06JUL 3488.30 147.025 20
07JUL 3434.20 157.637 20
08JUL 3475.80 258.949 20
09JUL 3518.10 211.566 20
10JUL 3492.65 193.779 20
11JUL 3496.40 212.024 20
12JUL 3398.50 199.201 20
13JUL 3456.05 173.455 20
14JUL 3493.60 187.465 20
15JUL 3563.30 205.472 20
16JUL 3519.05 173.676 20
17JUL 3474.20 200.576 20
18JUL 3443.60 222.084 20
19JUL 3586.35 185.724 20
20JUL 3486.45 223.474 20
21JUL 3492.90 145.267 20
22JUL 3432.80 190.994 20
23JUL 3496.90 208.858 20
Figure 44.3: The Summary Data Set OILSUM

There is exactly one observation for each subgroup (note that the subgroups are still indexed by DAY). The variable KWATTSX contains the subgroup means, the variable KWATTSS contains the subgroup standard deviations, and the variable KWATTSN contains the subgroup sample sizes (which are all 20). You can read this data set by specifying it as a HISTORY= data set in the PROC SHEWHART statement, as follows:

   title 'Mean and Standard Deviation Charts for Power Output';
   proc shewhart history=oilsum lineprinter;
      xschart kwatts*day='*';
   run;

The resulting \bar{X} and s charts are shown in Figure 44.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 KWATTS is not the name of a SAS variable in the data set OILSUM but is, instead, the common prefix for the names of the three SAS variables KWATTSX, KWATTSS, and KWATTSN. The suffix characters X, S, and N indicate mean, standard deviation, and sample size, respectively. Thus, you can specify three subgroup summary variables in the HISTORY= data set with a single name (KWATTS), which is referred to as the process. The name DAY specified after the asterisk is the name of the subgroup-variable.

 
Mean and Standard Deviation Charts for Power Output

                                                                      3 Sigma Limits  
                                                                      For n=20:       
  M       ----------------------------------------------------------                  
  e 3700 +                                                          |                 
  a      |                                                          |                 
  n      |==========================================================| UCL = 3618.9    
    3600 +                                             *            |                 
  o      |                                 *+         + +           |                 
  f      |               *+              ++  +*       +  +          | =               
    3500 +*+---+*------++--+*++*-------+*------++----+----*++*-----*| X = 3485.4      
  k      |  +*+  ++  +*         +    *+          *+  +        ++ ++ |                 
  w      |         *+            + ++              +*           *   |                 
  a 3400 +                        *                                 |                 
  t      |==========================================================| LCL = 3351.9    
  t      |                                                          |                 
  s 3300 +                                                          |                 
          +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                  
          ----------------------------------------------------------                  
  k  300 +==========================================================| UCL = 292.6     
  w  250 +            *+                                            | -               
  a  200 +*++*+-----++--+*++*++*++*+---+*++*+---+*++*++*++*+---+*++*| S = 196.4       
  t  150 +     +*++*                +*+      +*+            +*+     |                 
  t  100 +==========================================================| LCL = 100.2     
  s   50 +                                                          |                 
          +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+                  
         JUL                                                   JUL                    
          04    06    08    10    12    14    16    18    20    22                    
                                                                                      
                             Date of Measurement                                      
                                                                                      
  Subgroup Sizes:  * n=20                                                             
Figure 44.4: \bar{X} and s Charts for Power Output Data

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


Furthermore, the names of the subgroup mean, standard deviation, and sample size variables must begin with the process name specified in the XSCHART statement and end with the special suffix characters X, S, 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. For an illustration, see Example 44.2.

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.