This warning message arises when the data set is not sorted by subject and time, and this causes SAS to be "unsure" about the ordering of effects. In general, when your longitudinal data set is sorted by subject and time, you can omit the "time" classification variable from the repeated statement (see the documentation). When, however, the data is not sorted properly, PROC MIXED is thrown off.This is a very-quickly simulated data set and set of procedures that illustrates the issue. Notice that the final PROC MIXED statement runs without the Warning statement after the input data set is sorted and Time is explicitly added to the REPEATED statement.
data want;
do i = 1 to 50;
do group = 'A';
do time = 1, 2, 3, 4;
do y = rand('Normal' , 0, 1);output;
end;
end; end; end;
do i = 51 to 100;
do group = 'B';
do time = 1, 2, 3, 4;
do y = rand('Normal' , 1, 2);output;
end;
end; end; end;
run;
proc sort data=want;
by i y;
run;
proc mixed data=want;
class i group;
model y = time|group;
REPEATED / SUB=i (group) TYPE=AR(1);
run;
data broken; /*Add some missing values into the data set*/
set want;
if i = 4 and time =3 then do; time = .; y = . ; end;
if i = 40 and time =2 then time = .;
run;
proc mixed data=broken; /*This replicates your warning message*/
class i group;
model y = time|group;
REPEATED / SUB=i (group) TYPE=AR(1);
run;
proc sort data=broken out=fixed;
by i time;
run;
proc mixed data=fixed;
class i group time;
model y = time|group;
REPEATED time / SUB=i (group) TYPE=AR(1);
run;