Hello all,
I have a longitudinal study where participants come in for yearly visits and we assess metabolic outcomes and lifestyle factors as predictor variables. For example, how does sleep relate to BMI. I am trying to set up a proc mixed model but I am not sure how control for the fact that some participants contribute multiple observations to the dataset while others only contribute one. I am not interested in testing the effect of time, but rather how does sleep relate to BMI after controlling for some participants having multiple visits.
Here is an example of my code:
proc mixed data=a;
class id sex visit;
model BMI=accel_sleep_duration sex visit child_age / solution;
random visit id;
run;
Any suggestions would be appreciated! Thanks!
That would be better to post it at Statistical Forum(let @StatDave @lvm @SteveDenham see it):
Here is the code I proposed.
proc mixed data=a;
class id sex visit;
model BMI=accel_sleep_duration sex visit child_age / solution;
random int/subject= id;
repeated visit/subject= id;
run;
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.