不平衡数据集上的双向anova

Bra*_*ani 8 r anova

aov适合不平衡数据集.根据帮助...provides a wrapper to lm for fitting linear models to balanced or unbalanced experimental designs.但后来就说了aov is designed for balanced designs, and the results can be hard to interpret without balance.

我应该如何在R中的非平衡数据集上执行双向anova?

我想重现SAS输出的I型和III型平方和的不同结果(使用时proc glm).我记得我们type III sum of squares用于不平衡的数据集.

先感谢您.

Geo*_*tas 14

函数anova(或summary.aov)将为您提供所谓的I型(或顺序)平方和.要获得III型平方和,可以使用带参数的库中的Anova函数.这两个方法在不平衡数据集中的差异(以及生成两个表的R代码示例)在此处详细介绍.cartype="III"