admin管理员组文章数量:1122846
I am trying to run a type 3 Anova without an intercept. lme4 automatically adds an intercept when I run a linear model. I have tried running the model and specifying removal of the intercept, but this adds a degree of freedom to variable 'pop' and dramatically increases the F value. Below is the model (A) before and (B) after I try intercept removal. I also attached screenshots of the Anova table (1) with and (2) without the intercept. Any help would be greatly appreciated!
(A) all <- lm(logbasal ~ pop*sex*zPL, na.action = na.omit, data = totbmr)
(B) all <- lm(logbasal ~ pop*sex*zPL-1, na.action = na.omit, data = totbmr)
(1)
Response: logbasal
Sum Sq Df F value Pr(>F)
(Intercept) 67.388 1 4071.3329 < 2e-16 ***
pop 0.109 2 3.3032 0.04019 *
sex 0.001 1 0.0346 0.85271
zPL 0.000 1 0.0187 0.89147
pop:sex 0.130 2 3.9156 0.02257 *
pop:zPL 0.022 2 0.6642 0.51659
sex:zPL 0.044 1 2.6283 0.10764
pop:sex:zPL 0.097 2 2.9415 0.05667 .
Residuals 1.953 118
(2)
Response: logbasal
Sum Sq Df F value Pr(>F)
pop 148.486 3 2990.3318 < 2e-16 ***
sex 0.001 1 0.0346 0.85271
zPL 0.000 1 0.0187 0.89147
pop:sex 0.130 2 3.9156 0.02257 *
pop:zPL 0.022 2 0.6642 0.51659
sex:zPL 0.044 1 2.6283 0.10764
pop:sex:zPL 0.097 2 2.9415 0.05667 .
Residuals 1.953 118
I have tried two different ways to remove the intercept and both ways increase degrees of freedom for variabel 'pop.' Additionally, I am comparing my outputs to those run by someone using SAS, and we are getting different results even with the same data set. In SAS, the intercept is not automatically added to type 3 Anovas.
本文标签:
版权声明:本文标题:r - How do I remove the intercept from a type 3 Anova without adding a degree of freedom to a variable? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736309474a1934036.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论