options ls=78; title "Split-Plot Analysis - Dog Data"; /* After reading in the dog1 data, the variables are stacked * into two columns, one named 'time' for the time points and * one named 'k' for the quantitative response values. * The original p1 through p4 responses are removed. */ data dogs; infile "D:\Statistics\STAT 505\data\dog1.csv" firstobs=2 delimiter=','; input treat dog p1 p2 p3 p4; time=1; k=p1; output; time=5; k=p2; output; time=9; k=p3; output; time=13; k=p4; output; drop p1 p2 p3 p4; run; /* The class statement specifies treat, dog, and time * as categorical variables. * The model statement specifies k as the response and * treat, time, and treat-by-time interaction as factors. * dog (nested within treat) is also specified as a factor. * The h= option in the test statement is used to specify over * which groups the mean responses are to be compared. * The e= option specifies the error term for the test specified * in the test statement, which is treat here. */ proc glm data=dogs; class treat dog time; model k=treat dog(treat) time treat*time; test h=treat e=dog(treat); run;