06-02-2014 10:59 AM
When using different variables order in proc mixed, I get different results. For example with the following SAS program:
proc mixed data=table;
class trt center study visit subject;
model change = baseline visit trt center*study trt*visit baseline*visit;
repeated visit / type=un subject=subject;
lsmeans trt*visit / pdiff cl alpha = 0.05;
the model doesn't converge, whereas if the variables in the model statement are in the following order: model change = visit trt center*study trt*visit baseline baseline*visit; (the only difference is the order of the baseline variable) then the model converges .
How this could be explained as the variables order should not impact the results?
Many thanks for your help.
06-03-2014 08:23 AM
The sweep operator. During the multiple matrix inversions, the order of columns can affect many of the calculations, especially if there is collinearity (which is to be expected, at least a bit, with baseline and baseline*visit in the model). I have found it always seems like a good idea to list any continuous variables last in the model statement to try to get around this kind of behavior.