如何在 R 中使用 lmer() 检查 REML(或混合模型)中的 p 值?

时间:2021-07-30 11:36:57

标签: lme4

这是我的数据,我想进行 REML 分析以查看随机因子的方差分量。

Plant<- rep(c("P1","P2","P3","P4"), each=9)
Leaves<- rep(rep(c("L1","L2","L3"), each=3),4)
Rep<-rep(c(1,2,3),12)
Ca<- c(3.280, 3.090, 3.185, 3.520, 3.600, 3.560, 2.880, 2.800, 2.840, 2.460, 2.440,
       2.450, 1.870, 1.800, 1.835, 2.190, 2.100, 2.145, 2.770, 2.660, 2.715, 3.740,
       3.440, 3.590, 2.550, 2.700, 2.625, 3.780, 3.870, 3.825, 4.070, 4.200, 4.135,
       3.310, 3.400, 3.355)

tomato<- data.frame(Plant,Leaves,Rep,Ca)

这是我的代码

library(lme4)

lmer <- lmer(Ca ~ (1|Plant)+ (1|Plant:Leaves), REML=TRUE, data=tomato)
summary(lmer)

我假设叶子是嵌套的以种植。所以我编码为 (1|Plant:Leaves)

enter image description here

这个结果表明植物和叶子在数据中的变异性最大,而重复是次要的,不是吗?

然后,我想知道植物和离开(嵌套到植物)是否重要。我在哪里可以找到 p 值?或者我可以添加更多代码来检查 p 值吗?

或者在 REML 中,我们只能检查方差分量?

如果是这样,如果我选择植物作为固定因素,如下所示

lmer <- lmer(Ca ~ Plant+ (1|Plant:Leaves), REML=TRUE, data=tomato)
summary(lmer)

enter image description here

至少,在这个混合模型中,应该呈现植物的 p 值(= 固定因子)?不是吗?但是,我还是找不到。

您能指导我如何分析 REML 的结果吗?

0 个答案:

没有答案
相关问题