BookmarkSubscribeRSS Feed
he2182
Calcite | Level 5

I am trying to determine whether there is within person change in marijuana use over time in a multilevel model with repeated measures (days nested within people). 

The variables I have are:

marijuana - mj use per day

id - person id

studyday - 1-7 days

time01 - study day as 0 1 with even increments in between

Will this proc mixed code answer that question?

proc mixed data = mjuse covtest noitprint;

  class id studyday;

  model marijuana = time01 / solution cl outp = intp outpm = intpm  ;

  random intercept time01/ subject = id type = un g s gcorr;

  repeated /subject=id type = ar(1);

run;

1 REPLY 1
SteveDenham
Jade | Level 19

Why not:

proc mixed data = mjuse covtest noitprint;

  class id studyday;

  model marijuana = studyday / solution cl outp = intp outpm = intpm  ;

  repeated studyday /subject=id type = ar(1);

random intercept/subject=id;

run;

I guess I don't understand the coding for time01, so I automatically revert to fitting studyday.

This all assumes that marijuana is a continuous variable, and that everything has NID (0, sigma**2) errors.  If your response variable is something different, or has a large skew, you may need to consider a generalized mixed model.

Steve Denham

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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