Resources

EWMA Chart with Unequal Subgroup Sample Sizes

/*******************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                    */
/*                                                                 */
/*    NAME: MACEW4                                                 */
/*   TITLE: EWMA Chart with Unequal Subgroup Sample Sizes          */
/* PRODUCT: QC                                                     */
/*  SYSTEM: ALL                                                    */
/*    KEYS: Moving Average Charts,                                 */
/*   PROCS: MACONTROL                                              */
/*    DATA:                                                        */
/*                                                                 */
/* SUPPORT: saswgr                                                 */
/*     REF: PROC MACONTROL, EWMACHART Statement, Example 3         */
/*                                                                 */
/*******************************************************************/

data Clips4;
   input Day @;
   length Dayc $2.;
   informat Day ddmmyy8.;
   format   Day date5.;
   Dayc=put(Day,date5.);
   Dayc=substr(Dayc,1,2);
   do i=1 to 5;
      input Gap @;
      output;
   end;
   drop i;
   label Dayc='April';
   datalines;
 1/4/86  14.93  14.65  14.87  15.11  15.18
 2/4/86  15.06  14.95  14.91  15.14  15.41
 3/4/86  14.90  14.90  14.96  15.26  15.18
 4/4/86  15.25  14.57  15.33  15.38  14.89
 7/4/86  14.68  14.63  14.72  15.32  14.86
 8/4/86  14.48  14.88  14.98  14.74  15.48
 9/4/86  14.99  15.16  15.02  15.53  14.66
10/4/86  14.88  15.44  15.04  15.10  14.89
11/4/86  15.14  15.33  14.75  15.23  14.64
14/4/86  15.46  15.30  14.92  14.58  14.68
15/4/86  15.23  14.63    .      .      .
16/4/86  15.13  15.25    .      .      .
17/4/86  15.06  15.25  15.28  15.30  15.34
18/4/86  15.22  14.77  15.12  14.82  15.29
21/4/86  14.95  14.96  14.65  14.87  14.77
22/4/86  15.01  15.11  15.11  14.79  14.88
23/4/86  14.97  15.50  14.93  15.13  15.25
24/4/86  15.23  15.21  15.31  15.07  14.97
25/4/86  15.08  14.75  14.93  15.34  14.98
28/4/86  15.07  14.86  15.42  15.47  15.24
29/4/86  15.27  15.20  14.85  15.62  14.67
30/4/86  14.97  14.73  15.09  14.98  14.46
;

title 'The Data Set Clips4';
proc print data=Clips4(obs=15) noobs;
run;

ods graphics on;
title 'EWMA Chart for Gap Measurements';
proc macontrol data=Clips4;
   ewmachart Gap*Dayc / odstitle = title
                        weight   = 0.3
                        markers;
run;

title 'EWMA Chart for Gap Measurements';
proc macontrol data=Clips4;
   ewmachart Gap*Dayc / odstitle = title
                        weight   = 0.3
                        limitn   = 5
                        markers;
run;

title 'EWMA Chart for Gap Measurements';
proc macontrol data=Clips4;
   ewmachart Gap*Dayc/ odstitle = title
                       weight   = 0.3
                       limitn   = 5
                       alln
                       nmarkers;
run;

proc macontrol data=Clips4;
   ewmachart Gap*Dayc / outlimits = Cliplim1
                        outindex  = 'Default'
                        weight    = 0.3
                        nochart;
   ewmachart Gap*Dayc / smethod   = mvlue
                        outlimits = Cliplim2
                        outindex  = 'MVLUE'
                        weight    = 0.3
                        nochart;
   ewmachart Gap*Dayc / smethod   = rmsdf
                        outlimits = Cliplim3
                        outindex  = 'RMSDF'
                        weight    = 0.3
                        nochart;
run;

data Climits;
   set Cliplim1 Cliplim2 Cliplim3;
run;

title 'Estimating the Process Standard Deviation';
proc print data=Climits noobs;
run;