options ls=65 ps=54; title 'Fill Height Deviation Data in Table 6-13 pg. 259'; * Read data into SAS from an external file; filename raw '~/Montgomery/Data/tble6-13.dat'; data raw; infile raw; input factorA factorB factorC response; run; * Print the data; proc print data=raw; run; * Statistical analysis for three-factor factorial design with all interactions; proc glm data=raw; class factorA factorB factorC; model response=factorA|factorB|factorC / p; means factorA|factorB|factorC / lsd alpha=0.05; * Use lsmeans to get stage II analysis for significant interactions; lsmeans factorA*factorB / stderr tdiff pdiff; output out=temp p=fit r=resid student=stdresid; run; * Model adequacy checking (Residual Analysis); proc rank data=temp out=checkass normal=vw; var resid; ranks expected; run; proc plot data=checkass vpct=50 hpct=50; * Normal Probability Plot; plot expected*resid = '*' / box; * HOV, model adecuacy, and outlier detection; plot stdresid*fit = '*' / vref=-2 2 vrefchar='-' box; * HOV among factorA levels and outlier detection; plot stdresid*factorA = '*' / vref=-2 2 vrefchar='-' box; * HOV among factorB levels and outlier detection; plot stdresid*factorB = '*' / vref=-2 2 vrefchar='-' box; * HOV among factorC levels and outlier detection; plot stdresid*factorC = '*' / vref=-2 2 vrefchar='-' box; run; proc univariate data=checkass plot normal; var resid; run;