EWMA Chart with Individual Measurements

/*******************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                    */
/*                                                                 */
/*    NAME: MACEW5                                                 */
/*   TITLE: EWMA Chart with Individual Measurements                */
/* PRODUCT: QC                                                     */
/*  SYSTEM: ALL                                                    */
/*    KEYS: Moving Average Charts,                                 */
/*   PROCS: MACONTROL  SHEWHART                                    */
/*    DATA:                                                        */
/*                                                                 */
/* SUPPORT: saswgr                                                 */
/*     REF: PROC MACONTROL, EWMACHART Statement, Example 4         */
/*                                                                 */
/*******************************************************************/

data Tires;
   input Sample Diameter @@;
   datalines;
 1  24.05    2  23.99    3  23.95
 4  23.93    5  23.97    6  24.02
 7  24.06    8  24.10    9  23.98
10  24.03   11  23.91   12  24.06
13  24.06   14  23.96   15  23.98
16  24.06   17  24.01   18  24.00
19  23.93   20  23.92   21  24.09
22  24.11   23  24.05   24  23.98
25  23.98   26  24.06   27  24.02
28  24.06   29  23.97   30  23.96
;

proc shewhart data=Tires;
   irchart Diameter*Sample / nochart outlimits=Tlimits;
run;

title 'Control Limits for Diameter Measurements';
proc print data=Tlimits noobs;
run;

data Vrefdata;
   set Tlimits;
   length _reflab_ $16.;
   keep _ref_ _reflab_;
   _ref_ = _lcli_; _reflab_= 'LCL for X'; output;
   _ref_ = _ucli_; _reflab_= 'UCL for X'; output;
run;

title 'Reference Line Information';
proc print data=Vrefdata noobs;
run;

ods graphics on;
title 'EWMA Chart for Steel Belt Diameters';
proc macontrol data=Tires;
   ewmachart Diameter*Sample / weight     = 0.3
                               meansymbol = square
                               lcllabel   = 'LCL for EWMA'
                               ucllabel   = 'UCL for EWMA'
                               vref       = Vrefdata
                               odstitle   = title
                               vreflabpos = 3
                               markers;
run;