BookmarkSubscribeRSS Feed
yahoo0806
Calcite | Level 5

Hi all,

I'm just wondering if you have had such experience before: same exact data, fit into the "same" model (in my opinion, below two models are the same) but the convergence result is totally different (model one cannot converge, but model two can):

(I know model 1 LSMEANS statement asks for diff, but model 2 asks for pdiff. But i don't think this is the reason).

The only reason i can see and have tried it worked is to re-order the variables in class statement, i.e., to put pstudyid right after usubjid, just like the 2nd model. But Why? why does this matter? 

 

 

 

model 1:

proc mixed data=cdr0102_pool;
class usubjid avisitn anfgr02n adcmblfl region1 apoegr3 pstudyid; *===<apparently the order in class impact the convergence (pstudyid);
model chgtpt02 = anfgr02n avisitn avisitn*anfgr02n pstudyid pstudyid*avisitn tpt02 tpt02*avisitn mmsebl adcmblfl region1 apoegr3/ ddfm=kr residual;
repeated avisitn / type=un subject=usubjid;
lsmeans avisitn*anfgr02n/ diff cl;
run;

 

model 2:
proc mixed data=cdr0102_pool;
class usubjid pstudyid avisitn anfgr02n adcmblfl region1 apoegr3;
model chgtpt02 = anfgr02n avisitn avisitn*anfgr02n pstudyid pstudyid*avisitn tpt02 tpt02*avisitn mmsebl adcmblfl region1 apoegr3 / ddfm=kr residual;
repeated avisitn / type=un subject=usubjid;
lsmeans avisitn*anfgr02n / cl pdiff;
run;

1 REPLY 1
jiltao
SAS Super FREQ

When the optimization process is stable, the results should not be affected by different orders of independent variables in the model. However, when the optimization is not stable, the order of the effects might occasionally make a difference, for example, one model might not even converge while other models might converge successfully. The documentation here  https://go.documentation.sas.com/?docsetId=statug&docsetTarget=statug_mixed_details58.htm&docsetVers... provides some information on how to deal with convergence issues. For example,  " Rearranging effects in the MODEL statement so that the most significant ones are first can help, because PROC MIXED sweeps the estimate of X'V-1X in the order of the MODEL effects and the sweep is more stable if larger pivots are dealt with first. If this does not help, specifying starting values with the PARMS statement can place the optimization on a different and possibly more stable path. " 

In your case, the two programs have different orders of effects in the CLASS statements, that makes different orders of the design matrix for the interaction effect pstudyid*avisitn, which is essentially the same as specifying the model effects in different orders, so the issues discussed above could appear.

I hope that explains why your first program did not converge while your second program did converge. 

What is the error message for your first program?

Jill

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 658 views
  • 2 likes
  • 2 in conversation