% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mlmodel-tests.R
\name{vuongtest}
\alias{vuongtest}
\alias{vuongtest.mlmodel}
\title{Vuong's Test for Non-Nested Models}
\usage{
vuongtest(object_1, object_2, ...)

\method{vuongtest}{mlmodel}(object_1, object_2, ...)
}
\arguments{
\item{object_1}{A fitted model object inheriting from \code{"mlmodel"}.}

\item{object_2}{A fitted model object inheriting from \code{"mlmodel"}.}

\item{...}{Further arguments passed to methods (currently not used).}
}
\value{
An object of class \code{"vuongtest.mlmodel"} containing the test
statistic, p-value, and a conclusion (which model is preferred or
"inconclusive").
}
\description{
Performs Vuong's (1989) test for comparing two non-nested models fitted
via maximum likelihood with the \code{mlmodels} package.
}
\details{
Vuong's test compares two non-nested models by testing the null hypothesis
that the two models are equally close to the true data generating process.

The test statistic is based on the difference in the per-observation
log-likelihood contributions between the two models. A positive significant
value favors \code{object_1}, a negative significant value favors \code{object_2},
and a non-significant value leads to an "inconclusive" result.

Both models must be estimated on exactly the same sample.
}
\examples{

# Linear models example (lognormal vs gamma)
data(mroz)
mroz$incthou <- mroz$faminc / 1000

fit_lognormal <- ml_lm(log(incthou) ~ age + I(age^2) + huswage + educ + unem,
                       data = mroz)

fit_gamma <- ml_gamma(incthou ~ age + I(age^2) + huswage + educ + unem,
                      data = mroz)


vuongtest(fit_lognormal, fit_gamma)

# Count models example

fit_poi <- ml_poisson(docvis ~ private + medicaid + age + I(age^2) + educyr +
                          actlim + totchr,
                      data = docvis)

fit_nb1 <- ml_negbin(docvis ~ private + medicaid + age + I(age^2) + educyr +
                          actlim + totchr,
                      data = docvis,
                      dispersion = "NB1")

fit_nb2 <- ml_negbin(docvis ~ private + medicaid + age + I(age^2) + educyr +
                          actlim + totchr,
                      data = docvis)
                      
# Poisson vs. NB1
vuongtest(fit_poi, fit_nb1)

# NB1 vs. NB2
vuongtest(fit_nb1, fit_nb2)

# Binary models example
data(smoke)
smoke$smokes <- smoke$cigs > 0

fit_logit <- ml_logit(smokes ~ cigpric + income + age, data = smoke)
fit_probit <- ml_probit(smokes ~ cigpric + income + age, data = smoke)

vuongtest(fit_logit, fit_probit)

}
\references{
Vuong, Q. H. (1989). 'Likelihood Ratio Tests for Model Selection and Non-Nested
Hypotheses.' \emph{Econometrica}, 57(2), 307-333.
\doi{10.2307/1912557}
}
\seealso{
\code{\link[=lrtest]{lrtest()}}, \code{\link[=waldtest]{waldtest()}}, \code{\link[=IMtest]{IMtest()}}
}
