For clustered data (multiple test sites from the same subject), if I want to do one way ANOVA to compare the baseline values in each group, is the followint the right way to add the random effect from clustering in the ANOVA model ?
proc glm
data=mydata;
class treatment subjid;
model change = treatment;
random subjid;
run;
You really (REALLY) don't want to use GLM for any situation with random effects. This was OK before procedures like MIXED and GLIMMIX were written, but GLM should be avoided now. For your example, use:
proc mixed data=mydata;
class treatment subjid;
model change = treatment;
random subjid;
lsmeans treatment / diff;
run;
You really (REALLY) don't want to use GLM for any situation with random effects. This was OK before procedures like MIXED and GLIMMIX were written, but GLM should be avoided now. For your example, use:
proc mixed data=mydata;
class treatment subjid;
model change = treatment;
random subjid;
lsmeans treatment / diff;
run;
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!
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.