post hoc test for a two way mixed model anova

自古美人都是妖i 提交于 2019-12-12 12:50:13

问题


I am doing a repeated measures anova with a mixed model. I would like to run a post hoc test to see the p-values of the interaction TREAT*TIME, but I only managed to use the following ghlt Tukey test which do not give me the interaction I am looking for.

library(multcomp)
library(nlme)
oi<-lme(total ~ TREAT * TIME, data=TURN, random = ~1|NO_UNIT)
anova(oi)
summary(glht(oi, linfct=mcp(TIME="Tukey", TREAT="Tukey")))

what I would be looking for is something like:

summary(glht(oi, linfct=mcp(TIME="Tukey",TREAT="Tukey",TREAT*TIME="Tukey")))

回答1:


Use snk.test(model, term="TREAT*TIME", among="TREAT", within="TIME") from the package GAD if you have a balanced model and summary( lsmeans( oi, pairwise ~ TIME*TREAT), infer=TRUE) from lsmeans if your model is unbalanced




回答2:


I have also had this problem. It appears that a straight-forward post hoc test for two way ANOVAs does not exist. However, you may like to try bootstrapping, which is a form of robust estimation for a two-way ANOVA. I found the following link very helpful.

http://rcompanion.org/rcompanion/d_08a.html

It contains a step-by-step tutorial using the rcompanion,WRS2, psych, and multcompView packages to perform your bootstrapped ANOVA and follow up with a post hoc. Good luck.




回答3:


For a mixed model you can find an alternative with the aov_ez() function from the afex package instead of lme(), and then performe post hoc analysis using lsmeans().

You will find a detailed tutorial here:

https://www.psychologie.uni-heidelberg.de/ae/meth/team/mertens/blog/anova_in_r_made_easy.nb.html



来源:https://stackoverflow.com/questions/40831447/post-hoc-test-for-a-two-way-mixed-model-anova

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!