*! version 1.0.0 05-26-2019

Title

rdexo -- produces relevant estimates for testing the external validity of LATE to other compliance groups at the threshold according to
Bertanha and Imbens (2019).

Data

You need to have a dataset with one outcome variable (Y), one forcing variable (X), and one binary variable describing the actual treatment status (W). You have the option of using pre-treatment covariates (V1, ..., Vq).

Syntax

rdexo varlist(numeric) [if] [in]
,
[CUToff(numlist)]
[COVariate(varlist)]
[Hwidth(numlist>=0)]
[Bootstrap(numlist>0)]

where the capital letters indicate how you can abbreviate option names.

varlist: (required) enter the list of variables you want to regress in this order: outcome variable (Y), forcing variable (X), and binary treatment status variable (W).

[if] or [in]: (optional) like in any other STATA command, to restrict the sample you want to obtain your estimates from.

cutoff(numlist) or cut(numlist): (optional) the threshold that determines the assignment of treatment.
rdexo assumes that the participants are eligible for the treatment if the forcing variable is above the threshold
(default threshold is zero).

covariate(varlist) or cov(varlist): (optional) pre-treatment characteristics. If covariate is provided and data is fuzzy, rdexo will produce additional estimates adjusted for covariates.

hwidth(numlist>=0) or h(numlist>=0): (optional) bandwidth for estimating conditional mean jumps.
If you decide to use this option, make sure to specify hwidth or h as six numbers, regardless of other options:

h[1] is used to estimate E[Y|X=c+]-E[Y|X=c-].

h[2] is used to estimate E[W|X=c+]-E[W|X=c-]. In case the data is sharp, this jump won't be estimated.
Set h[2]=0 in this case.

h[3] is used to estimate E[Y|X=c+,W=0]-E[Y|X=c-,W=0]. In case the data is sharp on the right, this jump won't be estimated.
Set h[3]=0 in this case.

h[4] is used to estimate E[Y|X=c+,W=1]-E[Y|X=c-,W=1]. In case the data is sharp on the left, this jump won't be estimated.
Set h[4]=0 in this case.

h[5] is used to estimate E[Y|X=c+,W=0,V]-E[Y|X=c-,W=0,V], where V denotes a vector of covariates.
In case no covariates are provided
or the data is sharp on the right, this jump won't be estimated.
Set h[5]=0 in this case.

h[6] is used to estimate E[Y|X=c+,W=1,V]-E[Y|X=c-,W=1,V], where V denotes a vector of covariates.
In case no covariates are provided
or the data is sharp on the left, this jump won't be estimated.
Set h[6]=0 in this case.

If you do not use the hwidth option, then the bandwidths h[1], ..., h[4] are selected by the
Imbens and Kalyanaram (2012) (IK) method with edge kernel and local linear regression.
This requires the file "ikbw.ado".
In case covariates are used, h[5]=h[3] and h[6]=h[4].

bootstrap(numlist>0) or b(numlist>0): (optional) the number of bootstrap samples for variance estimation (default number is 1000).

Examples

Test external validity

. rdexo Y X W

Test external validity with one pre-treatment covariate V

. rdexo Y X W, cov(V)

Test external validity using specific cutoff, bandwidths, number of bootstrap samples, and no covariates

. rdexo Y X W, cut(1.3) h(27 39 28 37 0 0) b(1000)

Reference

Bertanha, M., and Imbens, G. (2019),
External Validity in Fuzzy Regression Discontinuity Designs.
Journal of Business & Economic Statistics (forthcoming)

Contributor to this Code:

Wei Qian, University of Notre Dame.