(关于SO的第一个问题,对任何错误深表歉意!)
我正在尝试使用线性混合模型分析数据,该模型考虑块(图)和基因型(线)效应,并通过 Welch-Satterthwaite 调整自由度来解释 WT(控制)的不同复制率。这是一个不完整的块设计,每个块中都包含 WT。
我用lmerTest::lmer
, 来构建模型
library(lmerTest)
biomass.lmer <- lmer(sqrt(Leaf_area) ~ Line + (1 | Plot) ,
data = biomass.allmeans)
anova(biomass.lmer)
到目前为止,一切都很好。考虑了 df 的 Satterthwaite 校正。但是当我尝试进行事后 Dunnett 测试时
dunnett.test <- glht(anova(biomass.lmer), linfct = mcp( Line = "Dunnett"), alternative = "two.sided")
summary(dunnett.test)
这没用。glht
无法处理由 . 返回的 S4 对象lmerTest::anova
。但是,lmerTest::lmer
也lme4::lmer
确实返回了一个有效对象,但后者不能考虑到 Satterthwaite 校正。
问题
我错过了什么吗?非常感谢有关如何将校正模型的方差分析转换为有效对象或使用不同方式对 S4 对象进行 Dunnett 测试的任何建议。
如建议的那样,数据(biomass.allmeans):
structure(list(Line = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, 6L), .Label = c("WT", "11-008",
"14-005", "2-94", "7-028", "8-93"), class = "factor"), Plot = structure(c(1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 2L, 4L, 5L, 8L,
9L, 10L, 11L, 2L, 3L, 5L, 7L, 8L, 10L, 12L, 1L, 3L, 5L, 6L, 7L,
9L, 12L, 1L, 2L, 4L, 6L, 7L, 10L, 11L, 12L, 1L, 3L, 4L, 6L, 8L,
9L, 11L), .Label = c("1", "2", "3", "4", "5", "6", "7", "8",
"9", "10", "11", "12"), class = "factor"), Leaf_area = c(3579.5,
3316.25, 4018.25, 3381, 3697.75, 2938.75, 2487.75, 1529.25, 2514.75,
2713.5, 2037.5, 3696.25, 3350, 1790.75, 1270, 2706.75, 2517.25,
4715, 3409.75, 3488.75, 2583.75, 1863, 1749.25, 2001, 2530.25,
3012, 3514.25, 2871.25, 1740.75, 2745.25, 3279, 2826.5, 3744.25,
1297.25, 1123.75, 691.5, 1263, 684.666666666667, 891.25, 873.5,
1461, 5217.75, 4867.25, 4629.75, 3748, 2693.75, 1615.5, 4407)), .Names = c("Line",
"Plot", "Leaf_area"), class = "data.frame", row.names = c(NA,
-48L))