options ls=65 ps=54;              
title 'Tensile Strength Experiment from Table 4-5 pg. 145';

* Read data into SAS from an external file;
filename raw '~/Montgomery/Data/tble3-1.dat';
data raw;
  infile raw;
  input strength wght_pct order;     /* "order" represents the order in which */
run;                                 /* the data was collected */ 

proc print data=raw;                                        /* print the data */
run;

proc npar1way data=raw anova wilcoxon;       /* Kruskal-Wallis Test for ANOVA */
  class wght_pct;
  var strength;
run;

* Pairwise comparisons using the Kruskal-Wallis Test;
proc npar1way data=raw wilcoxon;
  class wght_pct;
  var strength;
  where wght_pct=15 or wght_pct=20;
run;

proc npar1way data=raw wilcoxon;
  class wght_pct;
  var strength;
  where wght_pct=15 or wght_pct=25;
run;

proc npar1way data=raw wilcoxon;
  class wght_pct;
  var strength;
  where wght_pct=15 or wght_pct=30;
run;

proc npar1way data=raw wilcoxon;
  class wght_pct;
  var strength;
  where wght_pct=15 or wght_pct=35;
run;

proc npar1way data=raw wilcoxon;
  class wght_pct;
  var strength;
  where wght_pct=20 or wght_pct=25;
run;

proc npar1way data=raw wilcoxon;
  class wght_pct;
  var strength;
  where wght_pct=20 or wght_pct=30;
run;

proc npar1way data=raw wilcoxon;
  class wght_pct;
  var strength;
  where wght_pct=20 or wght_pct=35;
run;

proc npar1way data=raw wilcoxon;
  class wght_pct;
  var strength;
  where wght_pct=25 or wght_pct=30;
run;

proc npar1way data=raw wilcoxon;
  class wght_pct;
  var strength;
  where wght_pct=25 or wght_pct=35;
run;

proc npar1way data=raw wilcoxon;
  class wght_pct;
  var strength;
  where wght_pct=30 or wght_pct=35;
run;