Learn R Programming

pscl (version 0.5)

vuong: Vuong's non-nested hypothesis test

Description

Compares two models fit to the same data that do not nest.

Usage

vuong(m1, m2, digits = getOption("digits"))

Arguments

m1
model 1, an object inheriting from class glm, negbin or zeroinfl
m2
model 2, as for model 1
digits
significant digits in printed result

Value

  • nothing returned, prints the test-statistic and $p$ value and exits silently.

Details

The Vuong non-nested test is based on a comparison of the predicted probabilities of two models that do not nest. Examples include comparisons of zero-inflated count models with their non-zero-inflated analogs (e.g., zero-inflated Poisson versus ordinary Poisson, or zero-inflated negative-binomial versus ordinary negative-binomial). A large, positive test statistic provides evidence of the superiority of model 1 over model 2, while a large, negative test statistic is evidence of the superiority of model 2 over model 1. Under the null that the models are indistinguishable, the test statistic is asymptotically distributed standard normal.

The function will fail if the models do not contain identical values in their respective components named y (the value of the response being modeled).

References

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

Examples

Run this code
data(bioChemists)
glm1 <- glm(art ~ .,
            data=bioChemists,
            family=poisson,trace=TRUE)  ## poisson GLM

zip <- zeroinfl(count=art ~ .,
                x = ~ fem + mar + kid5 + phd + ment,
                z = ~ fem + mar + kid5 + phd + ment,
                dist="poisson",        
                data=bioChemists,trace=TRUE) ## zero-infl poisson

vuong(glm1,zip)

## compare negbin with zero-inflated negbin
require(MASS)
nb1 <- glm.nb(art ~ .,
              data=bioChemists,
              trace=TRUE)
zinb <- zeroinfl(count=art ~ .,
                 x = ~ fem + mar + kid5 + phd + ment,
                 z = ~ fem + mar + kid5 + phd + ment,
                 dist="negbin",
                 data=bioChemists,trace=TRUE)
vuong(nb1,zinb)

Run the code above in your browser using DataLab