/* SAS code for analyzing the plant acid data in problem 2 on assignment 8 in 2002. */ data set1; infile 'c:\courses\st511\sas\macid.dat'; input plants leaves method $ y; run; /* Print the data */ proc print data=set1; run; /* Use the MIXED procedure */ proc mixed data=set1; class plants leaves method; model y = method / solution e1 e3 outpm=set1 outp=set2;; random plants leaves(plants) / solution; ods output solutionr=setr; ods output covparms=setv; lsmeans method / pdiff; lsmeans method / pdiff adjust=Tukey; run; proc print data=setr; run; proc print data=setv; run; data setr1; set setr; if(Effect="plants"); run; data setr2; set setr; if(Effect="plants") then delete; run; proc rank data=setr1 normal=blom out=setr1 ; var estimate; ranks q; run; axis1 label=(f=swiss h=2.5) value=(f=swiss h=2.0) w=3.0 length= 6.5 in; axis2 label=(f=swiss h=2.0 r=90 a=270) value=(f=swiss h=2.0) w= 3.0 length = 5.0 in; SYMBOL1 V=circle H=2.0 w=3 l=1 i=none ; proc gplot data=setr1; plot estimate*q / vaxis=axis2 haxis=axis1; title H=3.0 F=swiss "Normal Plot: Plant Effects"; label q='Standard Normal Quantiles '; label clinic = 'Effects '; run; proc rank data=setr2 normal=blom out=setr2; var estimate; ranks q; run; proc gplot data=setr2; plot estimate*q / vaxis=axis2 haxis=axis1; title H=3.0 F=swiss "Normal Plot: Leaf Effects"; label q='Standard Normal Quantiles '; label clinic = 'Effects '; run; proc rank data=set1 normal=blom out=set1 ; var resid; ranks q; run; proc gplot data=set1; plot resid*q / vaxis=axis2 haxis=axis1; title H=3.0 F=swiss "Normal Plot: Residuals"; label q='Standard Normal Quantiles '; label resid = 'Residuals'; run; proc gplot data=set1; plot resid*pred / vaxis=axis2 haxis=axis1; title H=3.0 F=swiss "Residual Plot"; label pred='Estimated Means'; label resid = 'Residuals'; run;