为什么 lmer 在结果中将我的因子分成所有级别?

问题描述

我正在为具有 4 个级别的预测变量 root.type 上的单个响应变量运行线性混合模型;当我运行模型时,我只想要有关整个因素的信息,但它一直将其拆分为多个级别。有什么想法吗?

Ca.auto <- lmer(Ca ~ root.type + (1|pot),data)
summary(Ca.auto)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModlmertest]
Formula: Ca ~ root.type + (1 | pot)
   Data: autotroph

REML criterion at convergence: -17.5

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-2.2204 -0.4872 -0.1147  0.4371  3.6250 

Random effects:
 Groups   Name        Variance Std.Dev.
 pot      (Intercept) 0.00000  0.0000  
 Residual             0.02884  0.1698  
Number of obs: 42,groups:  pot,12

Fixed effects:
                               Estimate Std. Error       df t value
(Intercept)                     1.62108    0.05120 38.00000  31.660
root.typeunparasitized host    -0.99282    0.07241 38.00000 -13.711
root.typeattached hemiparasite -0.57593    0.07420 38.00000  -7.762
root.typeparasitized host      -0.97373    0.07420 38.00000 -13.123
                               Pr(>|t|)    
(Intercept)                     < 2e-16 ***
root.typeunparasitized host    2.72e-16 ***
root.typeattached hemiparasite 2.35e-09 ***
root.typeparasitized host      1.09e-15 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Correlation of Fixed Effects:
            (Intr) rt.typnh rt.typth
rt.typnprsh -0.707                  
rt.typttchh -0.690  0.488           
rt.typprsth -0.690  0.488    0.476  
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see ?isSingular

我只期待一种固定效果 (root.type)。我更新了软件包,但没有任何变化。

解决方法

这是 R 建模包相当标准的行为(即,summary() 函数报告参数级信息)。获取术语级别结果的一些选项是:car::Anova()afex::mixed();由于您使用的是 lmerTest 而不是 lme4anova()drop1() 也可以使用。

对于上面显示的特定示例,

  • 由于您有 38 df,因此有限大小的修正非常小(例如,2.5% 的上尾位于 qt(0.975,38)==2.02 而不是 1.96)
  • 您对 root 的逐项结果可能会报告为 < 2e-16,因为各个对比的 p 值已经非常小......