- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
PROC MIXED DATA=dataset;
CLASS SubjectID group time;
MODEL dependent_variable = group time group*time;
REPEATED time /subject=SubjectID ;
LSMEANS group*time / PDIFF ADJUST=tukey;
RUN;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Related to "homogeneity of variance" ,I think Mixed Model essentially take care of it,
Think about it ,why you have to use PROC MIXED ? it is just because one of hypothesis of GLM is "homogeneity of variance". Mixed Model would take into count of the correlation between clusters which is caused by heteroscedasticity(non-homogeneity of variance).
If you want check the RANDOM effect is significant or not, try COVTEST option:
PROC MIXED DATA=dataset COVTEST;
CLASS SubjectID group time;
MODEL dependent_variable = group time group*time /residual;
REPEATED time /subject=SubjectID type=un ;
LSMEANS group*time / PDIFF ADJUST=tukey;
RUN;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much! Your input helped me a lot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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