零相关 NB - 没有找到'model_count'对象。

问题描述 投票:0回答:1

我正在建立一个中介零膨胀负二项式(ZINB)模型。我正在按照O'Rourke & Vazquez(2019)的步骤--&gt。https:/www.sciencedirect.comsciencearticleabspiiS0306460319301078

几天前,我运行了一个不同的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)

我已经检查了统计分析的假设等等,特别奇怪的是,几天前一个类似的模型确实运行了,但现在却没有了。我今天确实尝试安装了几个包,但遇到了一个非零的退出状态。按照stackoverflow上的一些评论,我安装了一个包,添加了dependencies = 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

Anyone some suggestionsinsights?Thanks in advance!

编辑:在运行非零膨胀的负二项模型时,我确实得到了一个正常的输出。下面的代码运行平稳。

summary(ex1nb <- glm.nb(Y1~ X1 + M1, data = mydata))

所以我认为我的数据是正常的?

r object statistics glm
1个回答
0
投票

我也得到了这个错误。我使用R 4.0然后尝试R 3.6。没有运气。

当我删除EM = TRUE参数时,我能够让错误消失。

我不知道这是否有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.