ANOM for a Two-Way Classification

/********************************************************************/
/*          S A S   S A M P L E   L I B R A R Y                     */
/*                                                                  */
/*    NAME: ANMXEX2                                                 */
/*   TITLE: ANOM for a Two-Way Classification                       */
/* PRODUCT: QC                                                      */
/*  SYSTEM: ALL                                                     */
/*    KEYS: ANOM Charts, Means Charts, XCHART, Two-Way, Two Factor  */
/*   PROCS: ANOM                                                    */
/*    DATA:                                                         */
/*                                                                  */
/* SUPPORT: saswgr                                                  */
/*     REF: PROC ANOM, XCHART Statement, Example 2                  */
/*                                                                  */
/********************************************************************/

data Cleaning;
   do position = 1 to 5;
      do depth = 1 to 3;
         do rep = 1 to 2;
            input concentration @@;
            output;
         end;
      end;
   end;
datalines;
15 16 15 14 19 5
15 16 14 14 0  8
19 15 16 16 11 8
18 16 19 15 8  14
15 12 19 15 8  11
;


ods graphics off;
proc glm data=Cleaning;
   class position depth;
   model concentration = position depth position*depth;
run;

ods graphics on;
title "ANOM for Effect of Position";
proc anom data=Cleaning;
   xchart concentration * position /
      mse      = 12.6
      dfe      = 15
      outtable = posmain
      odstitle = title;
   label position      = 'Position'
         concentration = 'Mean of Concentration';
run;

proc sort data=Cleaning out=Cleaning2;
   by depth;
run;

title "ANOM for Effect of Depth";
proc anom data=Cleaning2;
   xchart concentration * depth /
      mse      = 12.6
      dfe      = 15
      outtable = depmain
      odstitle = title;
   label depth           = 'Depth'
         concentration   = 'Mean of Concentration';
run;