data("bioChemists", package="pscl")
## compare penalized Poisson GLM and ZIP
glm1 <- glmreg(art ~ ., data = bioChemists, x.keep=TRUE, family = "poisson")
zip <- zipath(art ~ . | ., data = bioChemists)
vuong.test(glm1, which.min(glm1$bic), zip, which.min(zip$bic))
## compare penalized negbin with zero-inflated negbin
nb1 <- glmregNB(art ~ ., data=bioChemists, x.keep=TRUE)
zinb <- zipath(art ~ . | ., data = bioChemists, family = "negbin")
vuong.test(nb1, which.min(nb1$bic), zinb, which.min(zinb$bic))
Run the code above in your browser using DataCamp Workspace