*! version 1.1 11 Feb 2015
help hpc

Title

hpc -- Specification test to discriminate between models for non-negative data with many zeros

Syntax

hpc depvar indepvars [if] [in], a(varname) b(varname) [options]

options

cluster(clustvar) specifies that the test is performed using standard errors that are computed allowing for intra-cluster
correlation; the variable identifying the clusters is defined by clustvar

The current version of hpc does not allow weights.

Description

hpc computes the HPC test (Santos Silva, Tenreyro, and Windmeijer, 2015) for the case where the conditional expectation of
a nonnegative depvar is specified as the product of the exponential of a linear combination of indepvars, times a
function that is bounded between zero and one (and can be identically equal to one). Examples of such models are given in Table 1 of
Santos Silva, Tenreyro, and Windmeijer (2015). Other models that satisfy this condition are the Poisson and negative-binomial models
and their zero inflated counterparts. Besides the dependent variable (depvar) and a set of regressors (indepvars), hpc
requires the user to provide the fitted values of the conditional expectation of the two competing models as the arguments of a(varname)
and b(varname).

Options

cluster(clustvar) by default hpc computes the test statistics using heteroskedasticity robust standard errors.
The cluster option specifies that the test is performed using standard errors that also allow for intragroup correlation,
relaxing the usual requirement that the observations be independent. That is, the observations are independent across
groups (clusters) but not necessarily within groups. clustvar specifies to which group each observation
belongs; see .

Remarks

hpc was written by J.M.C. Santos Silva, Silvana Tenreyro, and Frank Windmeijer and it is not an official Stata
command. For further help and support, please contact jmcss@essex.ac.uk. Please notice that this software is provided
as is, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability,
fitness for a particular purpose and noninfringement. In no event shall the author be liable for any claim, damages or
other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the
software or the use or other dealings in the software.

Examples

Setup

. sysuse nlsw88.dta

Compare Mullahy's (1988) Modified Two-Part Model and an exponential model estimated by Poisson pseudo-maximum likelihood (the Modified Two-Part Model is model A)

. probit tenure union collgrad married race age

. predict p, p

. poisson tenure union collgrad married race age if tenure>0

. predict fp, n

. g f_two=fp*p

. poisson tenure union collgrad married race age

. predict f_one, n

. hpc tenure union collgrad married race age, a(f_two) b(f_one)

Compare a Poisson regression model with a zero-inflated model (the ZIP is model A)

. zip tenure union collgrad married race age, inflate(union collgrad married race age)

. predict f_zip, n

. hpc tenure union collgrad married race age, a(f_zip) b(f_one)

Saved results

hpc saves the following in r():

r(N_a) number of observations used in the auxiliary regression used to compute the test statistic when model A is the null hypothesis

r(R2_a) R-squared for model A

r(p_a) p-value of the hpc test when model A is the null hypothesis

r(t_a) hpc test statistic when model A is the null hypothesis

r(N_b) number of observations used in the auxiliary regression used to compute the test statistic when model B is the null hypothesis

r(R2_b) R-squared for model B

r(p_b) p-value of the hpc test when model B is the null hypothesis

r(t_b) hpc test statistic when model B is the null hypothesis

References

Mullahy, J. (1998), Much ado about two: Reconsidering retransformation and the two-part model in health econometrics,
Journal of Health Economics 17, 247-282.

Santos Silva, J.M.C., Tenreyro, S., and Windmeijer, F. (2015),
Testing Competing Models for Non-negative Data with Many Zeros, Journal of Econometric Methods, 4(1), pp.
29-46.