BookmarkSubscribeRSS Feed
Obsidian | Level 7

Hi everybody ,


I have a longitudinal data on Body Mass Index BMI  before and after medical intervention . I am running a mixed model that accounts for time interval between date of measurement  and the date of  intervention. I also included an interaction term. 


the data looks like this :


ID       BMI      Time_interval  Time 

1         29               -10              Before 

1         30              10                 After 

1         30.5           20                 After

2         30.1           -8                  Before 

2         29.5            11                 After 

2         28.7             18                After 


The model I used :


ods graphics on;

Proc mixed data = have  plots= (Maxpoints=none);

class ID Time ;
model      BMI=  Time Time_interval  Time*Time_interval  /solution residual outpm=marg outp=cond vciry 
influence(iter=0 effect=ID est) ;
random Time Time_interval /subject=pat_mrn_id type=UN g gcorr;
ods graphics off;


I keep receiving this message :

"Stopped because of too many likelihood evaluations"


any ideas ?

Jade | Level 19

The fact that your subjects are not measured at the same timepoints complicates things immensely.


It looks to me as if you are trying to fit BMI to time_interval, but that there is something unusual about the pre-intervention values.  Using an unstructured covariance matrix with so many time_interval values, and with not every subject at those times leads to definite convergence problems.


If all of your data looks like this for the first two IDs, I might consider recoding time_interval to something like:


data want;

set have;

if time_interval<=0 then era=0;

if 0<time_interval<=10 then era=1;

if 10<time_interval<20 then era=2;

...more like this if needed...



Then I would try to fit the following model:


Proc mixed data = want  plots= (Maxpoints=none);
class ID  era ;
model      BMI=  era /solution residual outpm=marg outp=cond vciry 
influence(iter=0 effect=ID est) ;
random intercept/subject=ID;
repeated era /subject=ID type=ARH(1) g gcorr;

Now if you really don't like aggregating time_interval like this, I would suggest fitting some sort of spline, using the EFFECT statement.


Steve Denham




Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 in conversation