mpath (version 0.1-20)

vuong.test: Vuong's non-nested hypothesis test

Description

Compares two models fit to the same data that do not nest via Vuong's non-nested test.

Usage

vuong.test(m1, s1, m2, s2, type=c("None","AIC", "BIC"), digits = getOption("digits"))

Arguments

m1
model 1, an object inheriting from class glm, negbin, zeroinfl, glmreg, glmregNB or zipath
s1
an integer value between 1 and m1$nlambda, only useful when model 1 is from glmreg, glmregNB or zipath
m2
model 2, as for model 1
s2
similar to s1
type
type of penalty on number of parameters when comparing models
digits
significant digits in printed result

Value

  • The test-statistic and $p$ value

Details

The Vuong non-nested test is based on a comparison of the predicted probabilities of two models that do not nest, subject to penalty on number of parameters. The test can be used for penalized or non-penalized Poisson (negative binomial) regression models, zero-inflated Poisson (negative binomial) models.

References

Vuong, Q.H. 1989. Likelihood ratio tests for model selection and non-nested hypotheses. Econometrica. 57, 307--333.

Achim Zeileis, Christian Kleiber and Simon Jackman (2008), Regression Models for Count Data in R, Journal of Statistical Software, 27(8), http://www.jstatsoft.org/v27/i08/

Examples

Run this code
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 DataLab