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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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