% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mlmodel-count-tests.R
\name{OVDtest}
\alias{OVDtest}
\title{Overdispersion Tests for Count Models}
\usage{
OVDtest(object)
}
\arguments{
\item{object}{An object of class \code{"mlmodel.count"} (fitted with
\code{ml_poisson()} or \code{ml_negbin()}).}
}
\value{
A list containing the results of the tests against NB1 and NB2
alternatives, with coefficient estimates, t-statistics, and p-values.
}
\description{
Performs Cameron and Trivedi's (1990) regression-based tests for overdispersion
in count models.
}
\details{
These tests evaluate the null hypothesis that the conditional variance equals
the conditional mean (the Poisson assumption). Rejection indicates overdispersion
and suggests that a negative binomial model may be more appropriate.

When the input object is not a Poisson model, a Poisson regression is fitted
internally using the value (mean) equation specification from \code{object} in order
to perform the test.
}
\examples{

# Poisson model
fit_pois <- ml_poisson(docvis ~ private + medicaid + age + I(age^2) + 
                       educyr + actlim + totchr, data = docvis)
OVDtest(fit_pois)

# Negative binomial model (the test still fits a Poisson internally using 
# only the value equation, so results are identical)
fit_nb2 <- ml_negbin(docvis ~ private + medicaid + age + I(age^2) + 
                     educyr + actlim + totchr, data = docvis)
OVDtest(fit_nb2)

}
\references{
Cameron, A. C., & Trivedi, P. K. (1990). 'Regression-based tests for overdispersion
in the Poisson model.' \emph{Journal of Econometrics}, 46(3), 347-364.
\doi{10.1016/0304-4076(90)90014-K}

Cameron, A. C., & Trivedi, P. K. (2013). \emph{Regression Analysis of Count Data} (2nd ed.).
Cambridge University Press. \doi{10.1017/CBO9781139013567}
}
\seealso{
\code{\link[=IMtest]{IMtest()}}, \code{\link[=GOFtest]{GOFtest()}}
}
\author{
Alfonso Sanchez-Penalver
}
