BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
fengyuwuzu
Pyrite | Level 9

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;
1 ACCEPTED SOLUTION

Accepted Solutions
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

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;

 

View solution in original post

1 REPLY 1
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

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;

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 1461 views
  • 3 likes
  • 2 in conversation