%macro tukey1df(data,response,treatment,block); /* Produces interaction plots and conducts Tukey's 1 degree of freedom test for interaction in an RCBD model. First produce the plots */ title 'Interaction Plot 1'; proc glm data=&data; class &block &treatment; model &response=&block &treatment &block * &treatment; ods select intplot; run; quit; title 'Interaction Plot 2'; proc glm data=ma2612.asphalt; class &treatment █ model &response=&treatment &block &treatment * █ ods select intplot; run; quit; title ' '; /* The next bit of code constructs the Tukey 1 df for nonadditivity test */ proc glm data=&data noprint; class &block &treatment; model &response=&treatment █ output out=zout1 p=predicted; run; quit; proc glm data=&data noprint; model &response= ; output out=zout2 p=mean; run; quit; data zboth; merge zout1 zout2; run; title 'Tukey Test for Interaction'; data tukey1; set zboth; rescale=predicted**2/(2*mean); run; proc glm data=tukey1; class &block &treatment; model &response=&block &treatment rescale; contrast 'Tukey eta' rescale 1; ods select contrasts; run; quit; title ' '; %mend tukey1df; /* Now run the macro for the asphalt data: */ %tukey1df(ma2612.asphalt,wear,type,site);