Chapter Contents |
Previous |
Next |
EWMACHART Statement |
See MACEW1 in the SAS/QC Sample Library |
The previous example illustrates how you can create EWMA 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 EWMACHART statement with data of this type.
The following data set (CLIPSUM) provides the data from the
preceding example in summarized form:
data clipsum; input day gapx gaps; gapn=5; datalines; 1 14.904 0.18716 2 15.014 0.09317 3 14.866 0.25006 4 15.048 0.23732 5 15.024 0.26792 6 15.126 0.12260 7 15.220 0.23098 8 14.902 0.17254 9 14.910 0.19824 10 14.932 0.24035 11 15.096 0.25618 12 14.912 0.16903 13 15.138 0.15928 14 14.798 0.26329 15 14.944 0.20876 16 14.896 0.09965 17 14.734 0.22512 18 15.046 0.24141 19 14.702 0.17880 20 14.788 0.16634 ;
A listing of CLIPSUM is shown in Figure 20.3. There is exactly one observation for each subgroup (note that the subgroups are still indexed by DAY). The variable GAPX contains the subgroup means, the variable GAPS contains the subgroup standard deviations, and the variable GAPN contains the subgroup sample sizes (these are all five).
You can read this data set by specifying it as a HISTORY= data set in the PROC MACONTROL statement, as follows:
title 'EWMA Chart for Gap Measurements'; proc macontrol history=clipsum lineprinter; ewmachart gap*day='*' / weight=0.3; run;
The resulting EWMA chart is shown in Figure 20.4. Since the LINEPRINTER * option is specified in the PROC MACONTROL statement, line printer output is produced. The asterisk (*) specified in single quotes after the subgroup-variable indicates the character used to plot points. This character must follow an equal sign.
Note that GAP is not the name of a SAS variable in the data set but is, instead, the common prefix for the names of the three SAS variables GAPX, GAPS, and GAPN. The suffix characters X, S, and N indicate mean, standard deviation, and sample size, respectively. Thus, you can specify three subgroup summary variables in a HISTORY= data set with a single name (GAP), which is referred to as the process. The variables GAPX, GAPS, and GAPN are all required. The name DAY specified after the asterisk is the name of the subgroup-variable.
|
In general, a HISTORY= input data set used with the EWMACHART statement must contain the following variables:
Furthermore, the names of subgroup mean, standard deviation, and sample size variables must begin with the process name specified in the EWMACHART 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 in the PROC MACONTROL statement to rename the variables for the duration of the MACONTROL procedure step (see "Creating Charts for Means and Ranges from Summary Data" for an example of the RENAME option).
In summary, the interpretation of process depends on the input data set.
For more information, see "HISTORY= Data Set" .
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.