GLMM:glmer()

问题描述

我是我的 scarab 数据集,我有物种的响应变量数 (Richness),我的解释变量是 9 条断面 (PbPPM) 中的铅浓度 (Plot) {1}}) 有 5 个样条。但是横断面的 5 个样本是每个变量 Plot 中的伪复制。解释一下,我没有 43 度自由度 (DF) (9*5= 45 = 1PbPPM - 1 = 43),我使用 GLMM 来考虑这个 ((1|Plot))。我的例子:

library(lme4) 
scarab <- read.csv("https://raw.githubusercontent.com/Leprechault/PEN-533/master/scarab.csv")
str(scarab)
#'data.frame':  45 obs. of  4 variables:
# $ TrapID  : num  1 2 3 4 5 6 7 8 9 10 ...
# $ Richness: num  11 10 13 11 10 8 9 8 19 17 ...
# $ PbPPM   : num  0.045 1.036 1.336 0.616 0.684 ...
# $ Plot    : Factor w/ 9 levels "1","2","3","4",..: 1 1 1 1 1 2 2 2 2 2 ...

# GLMM model
scara.glmer<-glmer(Richness~PbPPM + (1|Plot),data=scarab,family="poisson")
summary(scara.glmer)
#Generalized linear mixed model fit by maximum likelihood (Laplace
#  Approximation) [glmerMod]
# Family: poisson  ( log )
# Formula: Richness ~ PbPPM + (1 | Plot)
# ...
#Random effects:
# Groups Name        Variance Std.Dev.
# Plot   (Intercept) 0.2978   0.5457  
#Number of obs: 45,groups:  Plot,9
#Fixed effects:
#            Estimate Std. Error z value Pr(>|z|)    
#(Intercept)   1.9982     0.2105   9.495  < 2e-16 ***
#PbPPM        -0.5625     0.1198  -4.695 2.66e-06 ***
#---
#Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

#Correlation of Fixed Effects:
#      (Intr)
#PbPPM -0.368

基于这个分析,我有两个问题:

  1. 有任何方法可以在输出中找到校正后的自由度数,因为对我来说在 Number of obs: 45,9 中不清楚。

  2. 我想计算变量“Plot”方差的贡献,因为在 lmer() 模型中,我有变量的方差/残差方差 + 变量的方差。尽管如此,在 glmer() 中我没有剩余方差,我不喜欢在 icc() 包中使用 sjstats

提前致谢,

亚历山大

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)