Hi everyone,
I need some help with analyzing data from a study that examines dependent variables at two different time points across four treatment groups.
My dataset is in long format, and looks like this:
SubjectID Group Time Dependent_variable
1 2 Baseline 60
1 2 Post_Intervention 20
2 2 Baseline 23
2 2 Post_Intervention 14
3 3 Baseline 12
3 3 Post_Intervention 10
4 1 Baseline 20
4 1 Post_Intervention 22
I am planning to run a two-factor repeated measures ANOVA and tried the following code. Is this the correct approach?
PROC GLM DATA = dataset;
CLASS group time;
MODEL dependent_variable = group time group*time;
REPEATED time 2;
LSMEANS group*time / PDIFF ADJUST=tukey;
RUN;
Thanks so much!
Thanks a lot!
Is there an option to incorporate both normality of residuals and homogeneity of variance tests within the same procedure? I found a suggestion for testing normality of residuals (using QQ plots), but I haven't come across an option for testing homogeneity of variance.
PROC MIXED DATA=dataset;
CLASS SubjectID group time;
MODEL dependent_variable = group time group*time /residual;
REPEATED time /subject=SubjectID ;
LSMEANS group*time / PDIFF ADJUST=tukey;
RUN;
Thank you so much! Your input helped me a lot.
I realize this is late, but this is one situation where some of the options in GLIMMIX come in handy (see the GLIMMIX documentation). You can test for homogeneity of variance using the COVTEST statement in conjunction with using the Group= option in the RANDOM statement. My advice would be to fit the heterogeneous model no matter the result of the test, AS LONG AS you have sufficient data to fit the number of parameters needed for the covariance structures under consideration and the model converges without messages or errors.
SteveDenham
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →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.