2-way anova on unbalanced dataset

随声附和 提交于 2019-12-04 09:32:16

问题


Is aov appropriate for unbalanced datasets. According to help ...provides a wrapper to lm for fitting linear models to balanced or unbalanced experimental designs. But later on it says aov is designed for balanced designs, and the results can be hard to interpret without balance.

How should I perform a 2-way anova on an unbalanced dataset in R?

I would like to reproduce the different results for type I and type III sum of squares of SAS output (when using proc glm). I remember we were using type III sum of squares for unbalanced datasets.

Thank you in advance.


回答1:


Function anova (or summary.aov) will give you the so called type I (or sequential) sum of squares. To get type III sum of squares, you can use the Anova function from library car with parameter type="III". The difference between these two approaches in unbalanced datasets (and also sample R code to produce both tables) is presented in detail here.



来源:https://stackoverflow.com/questions/2624688/2-way-anova-on-unbalanced-dataset

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