BookmarkSubscribeRSS Feed
spatsassy
Fluorite | Level 6

I am just starting out with PROC MIXED and unable to find help at my university, so hoping someone here can help!

I am setting up a model where my outcome (weight) is measured 3 times (baseline, 12m, 18m) there is so much variability with the time weight was actually measured (baseline-68months) that I am using a continuous "time since intervention" variable. 

1. Do I need to center my time variable? why? 

2. Is there a general rule of thumb on when to use random slope v random intercept v both random slope and intercept? When I run it with random intercept + slope the model shows no interaction between gender*time, while the random intercept only model does—any thoughts on why this might be?

 

My base model is:

Weight= time since intervention

and my model w covariates 

weight= time since intervention +gender + age 

 

I was going to include a time*time var since we believe people lose more weight earlier in the study- does this make sense? 

When I DON’T center time this time*time var is significant vs not signif. when I do center time- any idea what this means? 

 

i want to test time*gender to see if the rate of weight loss differs by gender and will add that in the next model. - does this make sense? does the time variable in this case need to be time*time*gender?  

 

Any help or thoughts in general re mixed models is appreciated.

 

2 REPLIES 2
ballardw
Super User

Example of the raw data. Best as data step code pasted into a text box opened on the forum with the </> icon above the message window. Only need variables used in the model if that reduces the burden.

 

Example of what "centering" means to you or as applied to the raw data.

 

The entire Proc code.

spatsassy
Fluorite | Level 6

Here is an example of the data (there are more ppts, this is just the first 25 rows)

Time= time in months from intervention.

When I speak of centering, I would grand mean center the variable as follows (subtract the mean of TIME from TIME for each row):

Time_Cent= TIME- Time_MEAN;: 

</>

IDWEIGHTAGEGENDERTIME
25003122.0415220
25003122.0025225
25003121.88352212
25001121.7625630
25001121.7295638
25001121.69156312
25004122.1224220
25004122.0514227
25004122.02342213
25009121.796610
25009121.7636617
25009.661.
25015121.9044020
25015.402.
25015121.77740256
25026121.9095620
25026121.8695626
25026121.84356212
25027.3620
25027.362.
25027.362.
25048121.6194820
25048121.5734826
25048121.56848212
25059.5710

</>

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 569 views
  • 0 likes
  • 2 in conversation