【问题标题】:How to do r square for glmmTMB negative binomial mixed model with zero-inflation in r如何为 r 中零通货膨胀的 glmmTMB 负二项式混合模型做 r 平方
【发布时间】:2020-06-12 08:29:14
【问题描述】:

我用 glmTMB 制作了一个零膨胀负二项式模型,如下所示

M2<- glmmTMB(psychological100~ (1|ID) + time*MNM01, data=mnmlong,
                      ziformula=~ (1|ID) + time*MNM01, family=nbinom2())

summary(M2)

这是输出

 Family: nbinom2  ( log )
Formula:          psychological100 ~ (1 | ID) + time * MNM01
Zero inflation:                    ~(1 | ID) + time * MNM01
Data: mnmlong



AIC      BIC   logLik deviance df.resid 
  3507.0   3557.5  -1742.5   3485.0      714 

Random effects:

Conditional model:
 Groups Name        Variance Std.Dev.
 ID     (Intercept) 0.2862   0.535   
Number of obs: 725, groups:  ID, 337

Zero-inflation model:
 Groups Name        Variance Std.Dev.
 ID     (Intercept) 0.5403   0.7351  
Number of obs: 725, groups:  ID, 337

Overdispersion parameter for nbinom2 family (): 3.14 

Conditional model:
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)  2.89772    0.09213  31.451  < 2e-16 ***
time        -0.08724    0.01796  -4.858 1.18e-06 ***
MNM01        0.02094    0.12433   0.168    0.866    
time:MNM01  -0.01193    0.02420  -0.493    0.622    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Zero-inflation model:
            Estimate Std. Error z value Pr(>|z|)    
(Intercept) -0.29940    0.17298  -1.731 0.083478 .  
time         0.12204    0.03338   3.656 0.000256 ***
MNM01        0.06771    0.24217   0.280 0.779790    
time:MNM01  -0.02821    0.04462  -0.632 0.527282    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

想知道模型的R平方,尝试了以下2种方法都没有成功

MuMIn::r.squaredGLMM(M2)

r.squaredGLMM.glmmTMB(M2) 中的错误:r.squaredGLMM 不能(还) 以零通货膨胀处理“glmmTMB”对象

performance::r2_zeroinflated(M2)

residuals.glmmTMB(model, type = "pearson") 中的错误:pearson 零通胀或零通胀模型不实施残差 可变色散

你有什么建议?

【问题讨论】:

标签: r glm mixed-models variance model-fitting


【解决方案1】:

尝试基于似然比 (MuMIn::r.squaredLR) 的伪 R^2。您可能需要明确提供一个空模型进行比较。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-11-16
    • 2020-01-19
    • 1970-01-01
    • 2020-04-27
    • 1970-01-01
    • 1970-01-01
    • 2020-02-12
    相关资源
    最近更新 更多