Stata Command: testex

Stata Command: testex.ado

A statistical test of the exclusion restriction of an instrumental variable (IV) based on D'Haultfoeuille, Hoderlein, & Sasaki (2021). Use it when you consider running an IV regression and want to test the exclusion restriction of the IV to ensure that it is a valid IV.

Installation:    

    . ssc install testex

Help:    

    . help testex

Reference:  D'Haultfoeuille, X., Hoderlein, S & Sasaki, Y. (2021) Testing and Relaxing the Exclusion Restriction in the Control Function Approach. Journal of Econometrics, forthcoming. Paper

Title
    testex -- Executes a statistical test of the exclusion restriction of an        instrumental variable (IV).
Syntax
    testex y x z [if] [in] [, numboot(real)]

Description
    testex executes a statistical test of the exclusion restriction of an        instrumental variable (IV) based on D'Haultfoeuille, Hoderlein, &        Sasaki (2021).  The command takes as input a scalar outcome variable        y, a scalar endogenous variable x that is continuous, and a scalar        instrumental variable z.  If the instrument is not binary, then the        program transforms the original instrument into a binary one.  The        output of the command includes the p-value of the test and the        indicators of whether the test rejects the null hypothesis at various        levels of statistical significance.  The program gives a caution when        there is no crossing of conditional CDFs required by Assumption 5 in        D'Haultfoeuille, Hoderlein, & Sasaki (2021).

Option
    numboot(real) sets the number of multiplier bootstrap iterations to        compute the critical value of the test statistic. The default value        is numboot(1000).

Examples
    y outcome variable, x endogenous variable, z instrumental variable
    Test of the exclusion restriction:
    . testex y x z
    Setting the number of multiplier bootstrap iterations to 2000
    . testex y x z, numboot(2000)
    Including additive controls:
    . reg y controls    . predict residy, resid    . reg x controls    . predict residx, resid    . reg z controls    . predict residz, resid    . testex residy residx residz

Stored results
    testex stores the following in r():
    Scalars        r(N)           observations        r(nb)          Number of multiplier bootstrap iterations        r(bw)          Bandwidth        r(KS)          KS statistic        r(p)           P-value
    Macros        r(cmd)         testex

Reference

    D'Haultfoeuille, X., S. Hoderlein, & Y. Sasaki. 2021. Testing and Relaxing        the Exclusion Restriction in the Control Function Approach.  Journal of        Econometrics, forthcoming.   Link to Paper.

Authors
    Xavier D'Haultfoeuille, CREST-ENSAE, Palaiseau, France.    Stefan Hoderlein, Emory University, Atlanta, GA.    Yuya Sasaki, Vanderbilt University, Nashville, TN.