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

515 Views Asked by At

I am interested in getting first differences from a mixed logit model using the Zelig package. However, I am not able to run a mixed logit model in Zelig. I updated the Zelig package as instructed by the Zelig website.

I ran the mixed logit mode but I got the following error: Error: logit.mixed is not a supported model type.

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.

Is "logit.mixed" no longer available on Zelig? I am currently using R version 3.5.1 if that makes a difference.

2

There are 2 best solutions below

0
On

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(); 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. Then everything works fine.

4
On

It seems like logit.mixed is no longer supported by the zelig-package.

It was implemented in Zelig 4: http://zeligdev.github.io/ , but I can not find it in the currently supported models.

There is, however, a deprecated version of a package called ZeligMultilevel up on github available here.

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