BookmarkSubscribeRSS Feed
Jest
Obsidian | Level 7

Hello,

 

I have a longitudinal dataset with a continuous score outcome and baseline features which I am trying to model. The outcome varies between visits/years but not the exposure or the other variables.

I have been using proc mixed but keep getting that the model stopped because of infinite likelihood. I then tried putting ID*exposure in the subject statement and the convergence criteria was met. I am unsure why it would only work as such and if I can trust the model as such. I am pasting below how my data is setup and the code.

 

ID       Year    Outcome        Exposure            Age          v12            v13         v14         v15

1            0           96                   0                     50

1            1           97                   0                     50

1            2           98                   0                     50

1            3           94                   0                     50

2            0           99                   1                     44

2            2           93                   1                     44

2            4           92                   1                     44

2            6           95                   1                     44

3            0           91                   0                     57

3            2           98                   0                     57

3            3           94                   0                     57

3            4           96                   0                     57

 

This is the code I am using:

 

proc mixed data=data.fa;

class ID year exposure;

model outcome = exposure year outcome*year age v12 v13 v14 v15;

repeated/ subject=id*exposure type=cs;

run;

 

Any ideas why the convergence is only met when putting id*exposure in the subject statment in the proc mixed model above? Is this correct? Is the code above reading the data correctly? Do I need to format the data differently to make it read a longitudinal outcome with baseline fixed features?

 

Thank you!

 

 

 

2 REPLIES 2
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

Quick thoughts:

 

1. Having "outcome*year" in the MODEL statement as a predictor is just wrong when outcome is the response. You probably mean "exposure*year".

 

2. Does ID have a unique value for each subject, or are you using the same value of ID with each level of EXPOSURE? Regardless, using subject=id*exposure is a good idea, and it's absolutely necessary if you have ID=1, etc. for multiple levels of EXPOSURE.

 

3. It's a good idea to specify the repeated measures factor in the REPEATED statement. Otherwise, the dataset must be sorted correctly.

repeated year / subject=id*exposure type=cs;

4. There could be issues with v12 v13 v14 v15.

 

HTH

Jest
Obsidian | Level 7

Hi HTH,

 

Thank you for the response. 

 

1) Yes you are correct it was exposure*year and not outcome*year...That was a typo

 

2) ID does have a unique value for each subject, however it is repeated for each measurement for the outcome and hence the baseline values as the data I described...

 

3) I added the repeated year in the statement and it worked. I got the same results

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 1639 views
  • 0 likes
  • 2 in conversation