Chapter Contents 
Previous 
Next 
MACHART Statement 
See MACMA1 in the SAS/QC Sample Library 
The previous example illustrates how you can create moving average 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 MACHART 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 21.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 'Moving Average Chart for Gap Measurements'; proc macontrol history=clipsum lineprinter; machart gap*day='*' / span=3; run;
The resulting moving average chart is shown in Figure 21.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 subgroupvariable 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 subgroupvariable.

In general, a HISTORY= input data set used with the MACHART
statement must contain the following variables:
In summary, the interpretation of process depends on the
input data set.
Chapter Contents 
Previous 
Next 
Top 
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.