作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在建模一个介导的零膨胀负二项式 (ZINB) 模型。我正在遵循 O'Rourke & Vazquez (2019) 的步骤 --> https://www.sciencedirect.com/science/article/abs/pii/S0306460319301078
几天前,我正在运行一个不同的 ZINB 模型,它运行得非常好。然而,今天我写了一个不同的模型,相同的变量,但不知何故它不再运行并给出一个奇怪的错误。当我尝试我以前的模型时,我突然得到同样的错误,即:
Error in zeroinfl(Y1 ~ X1 + M1 | X1 + : object 'model_count' not found
#loading required packages
library(psych)
library(foreign)
library(ggplot2)
library(MASS)
library(pscl)
library(nonnest2)
library(lmtest)
library(boot)
#Import data
mydata
#Fit a ZINB model
ex1zinb <- zeroinfl(X1 ~ Y1 + M1 | Y1 + M1, data = mydata, dist="negbin", EM= TRUE)
> library(psych)
> library(foreign)
> library(ggplot2)
Need help? Try Stackoverflow: https://stackoverflow.com/tags/ggplot2
Attaching package: ‘ggplot2’
The following objects are masked from ‘package:psych’:
%+%, alpha
> library(MASS)
> library(pscl)
Classes and Methods for R developed in the
Political Science Computational Laboratory
Department of Political Science
Stanford University
Simon Jackman
hurdle and zeroinfl functions by Achim Zeileis
> library(nonnest2)
This is nonnest2 0.5-3.
nonnest2 has not been tested with all combinations of model classes.
> library(lmtest)
Loading required package: zoo
Attaching package: ‘zoo’
The following objects are masked from ‘package:base’:
as.Date, as.Date.numeric
> library(boot)
Attaching package: ‘boot’
The following object is masked from ‘package:psych’:
logit
summary(ex1nb <- glm.nb(Y1~ X1 + M1, data = mydata))
最佳答案
我也遇到了那个错误。我使用了 R 4.0,然后尝试了 R 3.6。没运气。
当我删除 EM = TRUE 参数时,我能够让错误消失。
我不确定这是否有帮助。
关于r - 零通胀 NB - 找不到对象 'model_count',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61363189/
我是一名优秀的程序员,十分优秀!