BookmarkSubscribeRSS Feed
GDAL
Calcite | Level 5

Hello,

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;

run;

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.

Kind regards,

2 REPLIES 2
SteveDenham
Jade | Level 19

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.

Steve Denham

Manjusha_Gondil
Calcite | Level 5

Hi,

Always put categorical variables first and then continuous in model.

Thanks,

Manjusha

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 958 views
  • 1 like
  • 3 in conversation