admin管理员组文章数量:1122832
I have been analyzing strip plot (split block) experiments using the aov()
function from R:base
with an Error term
and got correct numbers for degrees of freedom (df)
of the residuals of main effects and interaction.
However, I was told that using linear mixed models would be advantageous, and so I tried the lmer()
function from library lme4.
Unfortunately, the resulting number of df
for residuals seems to depend on the data. Does that mean that the lmer()
function is not applicable to each and every data set?
Here is an example:
In 3 blocks, two factors A
(4 levels) and B
(3 levels) are laid out as orthogonal strips.
The classical ANOVA
gives for:
*aov(y~A*B + Error(block/(A+b))
Residuals (block): 2df
Residuals (A): 6 df
Residuals (B): 4 df
Residuals (A x B): 12 df
With the lmer
function (using libraries lme4 and lmerTest):
anova(lmer(y~A*B + (1|block/A) + (1|block/B))
I get sometimes correct numbers of DenDF
, but not all the times it do, for example:
Residuals (A): 6
Residuals (B): 16
Residuals (A x B): 16
How can the number of df
depend on the values of the depending variable y
?
Do I have a mistake in my formula?
本文标签:
版权声明:本文标题:statistics - Analyzing strip plot (split block) experiments with R:base or R:lme4 - lmer function giving spurious results? - Sta 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736304191a1932147.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论