option nocenter ps=50 ls=72; data new; infile "soy.dat"; input farm fert var resp; proc glm; class farm fert var; model resp=farm fert farm*fert var farm*var fert*var; test h=fert e=farm*fert; test h=var e=farm*var; output out=subplot r=res p=pred; proc gplot; plot res*pred; proc sort data=new; by farm fert; proc means NOPRINT; var resp; by farm fert; output out=new1 mean=resp1; proc glm; class farm fert; model resp1=farm fert; output out=wholeplot r=res p=pred; proc gplot; plot res*pred; proc glm data=new; class farm fert var; model resp=farm|fert var fert*var; test h=fert e=farm*fert; run;