在具有 ZI 模型的 glmmTMB 对象上使用 predict() 时,它是否仅基于条件模型生成预期值?

问题描述

我的模型具有条件和零通胀元素。我正在使用 predict 从我的模型中获取预期值。我已经设置了 type = "response" 并且它提到了如何根据 predict.glmmTMB 文档中的零膨胀模型和非零膨胀模型产生预期值。我在 pred 中的值是否有条件,即只是模型的 NB 部分?

模型:

mod <- glmmTMB(Freq ~ Species * logging + (1|depl_ID),ziformula= ~ Species + logging,family=nbinom2,data=dat7,offset = log(depl_dur))

预测:

newd <- as.data.frame(cbind(unique(dat7[,c("logging","Species")]),depl_ID = "B10-2-16_20120806",Freq = 0,depl_dur = 1))

rownames(newd) <- NULL

pred <- predict(mod,newd,re.form = ~0,type = "response",se.fit = TRUE)

newd <- transform(newd,fit = pred$fit,se = pred$se.fit,fit.up = pred$fit + pred$se.fit,fit.down = pred$fit - pred$se.fit)

解决方法

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

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

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