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;
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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.