Title

countfit -- Compare fit of alternative count models

General syntax

countfit
[varlist]
[if]
[in]
,
[ inflate(varlist)
noconstant
prm
nbreg
zip
zinb
stub(prefix)
replace
nosave
note(string)
nograph
nodifferences
noprtable
noestimates
nofit
forcevuong
nodash
max count(#)
noisily ]

Overview

countfit compares the fit of the Poisson, negative binomial, zero-inflated
Poisson and zero-inflated negative binomial models, generating a table of
estimates, a table of differences between observed and average estimated
probabilities for each count, a graph of these differences, and various tests
and measures used to compare the fit of count models.

Specifying the model

Immediately after the command name countfit you specify the dependent and
independent variables as you would with poisson or other count models. For
zero-inflated models, the inflate option is used in the same was as in the
zip and zinb commands. noconstant can be used to exclude the constant term.

Options to select the models to fit

By default, poisson, nbreg, zip and zinb are estimated. If you
only want some of these models, specify the models you want with:

Option Model estimated

prm poisson

nbreg nbreg

zip poisson

zinb poisson

Options to label results

stub() is up to five letters to name the variables that are created and to label the models in the output. This name is placed in front of the type of model (e.g., namePRM). This option helps keep track of results from multiple specifications of models.

replace will replace variables created with the ^generate^ option if they already exist.

nosave do not save variables generated to create graph.

note() is a label added to the graph that is saved.

Options controlling what is printed

maxcount() number of counts to evaluate.

noisily shows the output from the estimation commands called by countfit.

nograph suppress graph of differences from observed counts.

nodifferences suppress table of differences from observed counts.

noprtable suppresses table of predictions for each model.

noestimates suppress table of estimated coefficients.

nofit suppress table of fit statistics and test of fit

forcevuong Vuong test is not appropriate for testing zero-inflation. This
option forces the computation of the test. Greene (1994) proposed using the Vuong test for nonnested models (Vuong 1989) to test for zero
inflation. Despite many earlier citations, recent work by Wilson (2015) has shown that the Vuong
test is inappropriate for testing zero inflation. Nesting occurs when the probability of zero
inflation is 0, which is on the boundary, and this violates the regularity conditions of the Vuong
test for nonnested models. So the distribution of the test statistic is not standard normal. The
actual distribution is unknown and thus cannot be used for inference.

nodash suppress dashed lines between measures of fit

noisily includes output from Stata estimation commands; without this option the results are only shown in the estimates table output.

Notes

countfit is based on the results from the Stata models described above,
the predictions computed by mgen, and the fit measures computed by
fitstat.

Examples

. use couart4

. countfit art fem mar kid5 phd ment, inf(ment fem) nbreg zinb nograph