options formdlim = '-' nodate; data salinity; infile 'salinity.txt' firstobs = 2; /* on a pc: infile 'c:/Documents and Settings/pdixon.IASTATE/Desktop/salinity.txt' firstobs = 2; */ input trt $ container plant weight; proc plot; plot weight*container = trt; title 'Barley response to salinity'; proc mixed method = type3; class trt container; model weight = trt; random container(trt); lsmeans trt; title 'ANOVA estimates of variance components, using proc mixed'; run; /* stuff below here demonstrates three points */ proc mixed method = type3; class trt container plant; model weight = trt; random container(trt) plant(container*trt); title '1) Specifying three levels of variability'; run; proc mixed; class trt container; model weight = trt; random container(trt); lsmeans trt; title '2) REML estimates of variance components, using proc mixed'; /* To get REML estimates, remove the method = type3 from the */ /* proc mixed statement */ run; /* illustration that test of trt effects and se of diff */ /* as as '401' approach of averaging plants within container */ proc sort data = salinity; by trt container; proc means noprint; by trt container; var weight; output out = means mean = wtmean; run; proc print; title 'Container means'; run; proc glm; class trt; model wtmean = trt; lsmeans trt; title '3) GLM on container means'; run;