data sales; input Sales Market Campaign Time @@; datalines; 958 1 1 1 1005 2 1 1 351 3 1 1 549 4 1 1 730 5 1 1 1047 1 1 2 1122 2 1 2 436 3 1 2 632 4 1 2 784 5 1 2 933 1 1 3 986 2 1 3 339 3 1 3 512 4 1 3 707 5 1 3 780 6 2 1 229 7 2 1 883 8 2 1 624 9 2 1 375 10 2 1 897 6 2 2 275 7 2 2 964 8 2 2 695 9 2 2 436 10 2 2 718 6 2 3 202 7 2 3 817 8 2 3 599 9 2 3 351 10 2 3 ; run; * figure 27.6 (p. 1146); proc sgpanel data=sales; panelby campaign / rows=1 columns=2; series x=time y=sales / group=market; *rowaxis integer; run; * can (sequentially) drop both campaign and campaign*time; * can formally and elegantly test this with one F-test via contrast, but not easy; proc mixed data=sales plots=all; * conditional residual plots are what you want; class market campaign time; model sales=campaign|time; * factorial structure; random market; * 10 distinct markets each with own index; lsmeans time / pdiff adjust=tukey cl; run; *PROC MIXED has better residual diagnostics, but I want the test of sigma_rho; proc glimmix data=sales plots=all; class market campaign time; model sales=campaign|time; random market; covtest zerog; lsmeans time / pdiff adjust=tukey cl; run;