简体   繁体   English

Zelig (R) 中的混合 Logit 模型——未运行——不再可用?

[英]Mixed Logit Model in Zelig (R) -- not running -- not available anymore?

I am interested in getting first differences from a mixed logit model using the Zelig package.我有兴趣从使用 Zelig 包的混合 logit 模型中获得第一个差异。 However, I am not able to run a mixed logit model in Zelig.但是,我无法在 Zelig 中运行混合 logit 模型。 I updated the Zelig package as instructed by the Zelig website.我按照 Zelig 网站的指示更新了 Zelig 包。

I ran the mixed logit mode but I got the following error: Error: logit.mixed is not a supported model type.我运行了混合 logit 模式,但出现以下错误:错误:logit.mixed 不是受支持的模型类型。

I tried to run the model from the vignette and got the same error:我试图从小插图运行模型并得到同样的错误:

library(Zelig)
data(voteincome)
z.out1 <- zelig(vote ~ education + age + female +tag(1 | state), data=voteincome, model="logit.mixed")

I get the following error: Error: logit.mixed is not a supported model type.我收到以下错误:错误:logit.mixed 不是受支持的模型类型。

Is "logit.mixed" no longer available on Zelig? Zelig 不再提供“logit.mixed”吗? I am currently using R version 3.5.1 if that makes a difference.如果这有所不同,我目前正在使用 R 版本 3.5.1。

Replying to this older post in case anyone else is doing this as well.回复这篇较旧的帖子,以防其他人也这样做。 Looks like the instructions here to use the remotes package to download ZeligMultilevel currently work better than devtools::install_github();看起来这里的说明使用 remotes 包下载 ZeligMultilevel 目前比 devtools::install_github(); I ran into the same dependency problem as the previous user.我遇到了与前一个用户相同的依赖问题。

Instead, users can use this code, available here :相反,用户可以使用此代码,可在此处获得

install.packages("remotes")

remotes::install_github("IQSS/ZeligMultilevel")

Just remember to accept the remotes package's suggestion to update all packages.请记住接受 remotes 包的建议以更新所有包。 Then everything works fine.然后一切正常。

It seems like logit.mixed is no longer supported by the zelig -package. logit.mixed似乎不再支持zelig

It was implemented in Zelig 4: http://zeligdev.github.io/ , but I can not find it in the currently supported models .它是在 Zelig 4 中实现的:http: //zeligdev.github.io/ ,但我在当前支持的模型中找不到它。

There is, however, a deprecated version of a package called ZeligMultilevel up on github available here .但是,github 上一个名为ZeligMultilevel up 的不推荐使用的软件包版本,可在此处获得

You can try:你可以试试:

devtools::install_github("IQSS/ZeligMultilevel")

and then, followed by the demo , you can:然后,在演示之后,您可以:

library(ZeligMultilevel)


data(voteincome)

z5 <- zlogitmixed$new()
z5
z5$zelig(vote ~ education + age + female + (1 | state),
         data = voteincome)
z5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM