Chapter Contents 
Previous 
Next 
EWMACHART Statement 
See MACEW6 in the SAS/QC Sample Library 
The EWMAARL DATA step function computes the average run length for an exponentially weighted moving average (EWMA) scheme (refer to Crowder 1987a,b for details). You can use this function to design a scheme by first calculating average run lengths for a range of values for the weight and then choosing the weight that yields a desired average run length.
The following statements compute the average run lengths for shifts between 0.5 and 2 and weights between 0.25 and 1. The data set ARLS is displayed in Output 20.5.1.
data arls; do shift=.5 to 2 by .5; do weight=.25 to 1 by .25; arl=ewmaarl(shift,weight,3.0); output; end; end; run;
title 'Average Run Lengths for Various Shifts and Weights'; proc print data=arls noobs; by shift; run;Output 20.5.1: Listing of the Data Set ARLS
In addition to using the EWMAARL function to design a EWMA scheme with desired average run length properties, you can use it to evaluate an existing scheme. For example, suppose you have an EWMA chart with control limits using a weight parameter of 0.3. The following DATA step computes the average run lengths for various shifts using this scheme:
data arlinfo; do shift=0 to 2 by .25; arl = ewmaarl(shift,0.3,3.0); output; end; run;
title 'Average Run Lengths for EWMA Scheme (k=3 and r=0.3)'; proc print data=arlinfo noobs; run;
The data set ARLINFO is displayed in Output 20.5.2.
Output 20.5.2: Listing of the Data Set ARLINFO

Chapter Contents 
Previous 
Next 
Top 
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.