*! version 1.0.0 25jun2014
help cmi_test

Title

cmi_test -- Implement the conditional moment inequality test proposed by Andrews and Shi(2013)

Syntax

cmi_test
(cmi vars)
(cme vars)
indepvars
[if] [in]
[,
rnum(#)
hd
boot
ks
sfunc(#)
epsilon(real)
kap(real)
bn(real)
rep(#)
seed(#)
simul
]

Description

cmi_test implements the conditional moment inequality testing procedure proposed in Andrews and Shi(2013) for general moment inequality models with a finite number of conditional moment restrictions and a finite-dimensional parameter.
Specifically, it tests the null hypothesis: E[cmi vars|indepvars]>=0 and E[cme vars|indepvars]=0.
The command allows cmi vars or cme vars to be empty.

cmi_test uses countable hypercubes as the collection of instrumental functions.
When the dimension of indepvars is greater than 3, the number of cubes may be too large which cuases long computation time.
The command allows an alternative method for high dimensional independent variables. The user can select the hd option to opt for this method.
This option implements the method described in the last paragraph of Section 9 of Anrews and Shi(2013).

Options

rnum(#) sets a scalar indicating the minimum side-edge lengths; default is the smallest interger which is greater than r(N)^(DX/2)/2, where DX is the dimension of indepvars.

hd uses alternative method for high dimensional independent variables. This option is designed for three or more covariates; see the description for details.

boot lets the user turn on the bootstrap option. If this option is not used, the command computes the cirtical value based on a Gaussian asymptotic approximation.

ks uses the Kolmogorov-Smirnov type statistic; default is the Cramer-von Mises type statistic.

sfunc(#) sets the function S to specify the form of the test statistic. sfunc(1) yields the modified method of moments or Sum function and sfunc(3) yields the Max function; the default is sfunc(1).

epsilon(real) sets the regularization parameter epsilon for the sample variances; the default is epsilon(0.05).

kap(real) sets a tuning parameter in the data-dependent GMS function phi_n(g); see (4.9) of Andrews and Shi(2013) for details. the default is (0.3 * log(r(N)))^(1/2).

bn(real) sets a tuning parameter in the data-dependent GMS function phi_n(g); see (4.10) of Andrews and Shi(2013) for details. the default is (0.4 * log(r(N))/log(log(e(N))))^(1/2).

rep(#) sets the number of repetitions for the critical value simulation; the default is rep(5001).

seed(#) sets the seed number for the critical value simulations; the default is seed(10000).

simul lets the user choose to leave the seed number for the critical value simulations unset. This option should be turned on when the command is used inside a Monte Carlo simulation loop, so as not to interfere with the random number generation process set for the Monte Carlo simulation exercise.

Stored results

cmi_test stores the following in r():

Scalars

r(N) number of observations

r(stat) test statistic

r(pval) p-value

r(cv01) critical value for the 1% sigficiance level

r(cv05) critical value for the 5% sigficiance level

r(cv10) critical value for the 10% sigficiance level

r(kappa) tuning parameter kappa_n

r(B) tuning parameter B_n

r(epsilon) tuning parameter epsilon

r(rep_cv) repetitions for critical values

r(a_obs) average number of observations in the smallest cubes

r(r_n) index for minimum side-edge lengths

r(ncube) number of cubes

Macros

r(cmd) cmi_test

r(title) "Conditional Moment Inequalities Test"

r(m_ineq) varlist for conditional moment inequalities, if any

r(m_eq) varlist for conditional moment equalities, if any

r(x) varlist for regressors

Examples

Consider a missing data example.
Let Y be the logarithm of the potential wage after college enrollment.
The variable Y is observed only for those who actually did enroll in a college (D=1).
Suppose that the parameter of interest (theta_0) is the cumulative distribution function Y evaluated at log(20).
Then, the parameter satisfies

E[1(Y<=log(20),D = 1) + 1(D = 0) - theta_0|X1,X2] >=0
E[theta_0 - 1(Y<= log(20), D = 1)|X1,X2] >=0

The command carries out inference on theta_0 using a cross-sectional sample of (Y,D).

First, open the data set.

clear all

use cmitest.dta , clear

Then, construct the bounds.

gen lbound = ( Y < log(20) ) * D
gen ubound = ( Y < log(20) ) * D + 1 - D

Then, create two conditional moment inequalities.

gen CMI1 = 0.5 - lbound
gen CMI2 = ubound - 0.5

Then, the command is used to test the null hypothesis H_0: theta_0 = 0.5.

cmi_test (CMI1 CMI2) () X1 X2

Use the Kolmogorov-Smirnov type statistic:

cmi_test (CMI1 CMI2) () X1 X2, ks

Use Max function and the bootstrap critival value:

cmi_test (CMI1 CMI2) () X1 X2, sfunc(3) boot

References

Andrews, D., and X. Shi. 2013. Inference based on conditional moment inequalities.
Econometrica, Vol.81, No. 2, 609-666.