*! version 1.0.0 Oct 2017

Title

rddsga -- Subgroup analysis for regression discontinuity designs using inverse propensity score weighting

Syntax

rddsga depvar assignvar [indepvars] [if] [in]
, options

depvar is the outcome variable, assignvar is the assignment variable for which there is a known cutoff and indepvars are a set of control variables.

Subgroup and RDD
* sgroup(varname) subgroup indicator variable

treatment(varname) indicator for actual treatment status; if not specified, a sharp RDD is assumed

cutoff(real) specifies the cutoff value in assignvar; default is 0

* bwidth(real) specifies the bandwidth around the cutoff

Balance
+ balance(varlist) variables that enter the propensity score estimation; default is indepvars

probit predict propensity score using a [R] probit model; default is [R] logit

nocomsup do not restrict sample to area of common propensity score support

Model
firststage estimate the discontinuity in the treatment probability using OLS

reducedform estimate the reduced form effect using OLS

ivregress estimate the treatment effect using instrumental variable regression; requires that a treatment variable is specified in treatment(varname)

quadratic use quadratic spline; default is linear

vce(vcetype) vcetype may be unadjusted,
robust, cluster clustvar, bootstrap,
jackknife, or hac kernel; default is bootstrap

bsreps(#) perform # bootstrap replications; default is bsreps(50)

normal compute and report normal approximation p-values and CIs; default is percentile

nobootstrap do not compute bootstrap standard errors for RD estimates

noipsw do not use inverse propensity score weighting

Reporting and Output
dibalance display original balance and propensity score-weighted balance tables and statistics

ipsweight(newvar) name of new variable for the inverse propensity score weight for each observation; if not specified, no variable will be generated

comsup(newvar) name of new binary variable indicating common support; if not specified, no variable will be generated

pscore(newvar) name of new variable for the estimated propensity score; if not specified, no variable will be generated

* These options must be specified.

+ This option must be specified if indepvars is empty.

indepvars may contain factor variables; see fvvarlist.

Description

rddsga allows to conduct a binary subgroup analysis in RDD settings based on inverse propensity score weights (IPSW).
Observations in each subgroup are weighted by the inverse of their conditional probabilities to belong to that subgroup, given a set of covariates.
Analyzing the differential treatment effect in the reweighted sample helps isolating the difference due to the subgroup characteristic of interest from other observable dimensions.

rddsga computes IPSW based on the vector of covariates in indepvars, which are also used as control variables in the model.
A separate set of variables to compute IPSW may be optionally specified with balance(varlist).
A new variable with IPSW may be generated using psweight(newvar).
In order to assess the statistical significance of the difference in means for each covariate, rddsga uses a t-test on the equality of means and reports the resulting p-value, as well as the (weighted) standardized mean difference.
Joint significance is assessed using an F-test.
The resulting balance tables are stored as matrices (see stored results below), and may also be displayed using dibalance.

Options firststage, reducedform and ivregress may be used to estimate the first stage, reduced form and treatment effects using OLS and IV methods, respectively.
Standard variance estimator options may be used for these estimators with vce(vcetype).
The estimated coefficients for the interaction of indicator variables for each subgroup and a treatment indicator are reported, along with bootstrap standard errors (unless other vcetype is specified).

Additional details regarding the methodology implemented by rddsga can be found in the project's repository.
An application can be found in Gerardino, Litschig, Olken and Pomeranz (2017).

Options

RD design

sgroup(varname) specifies a subgroup indicator variable.
This variable must be a dummy (values 0 or 1).
This option must be specified.

treatment(varname) specifies an indicator variable for actual treatment status.
If not specified, a sharp RDD is assumed.

cutoff(real) specifies the cutoff value in assignvar; default is 0 (assuming normalized assignvar).

bwidth(real) specifies a symmetrical the bandwidth around the cutoff.
This option must be specified.

Balance

balance(varlist) specifies the variables that enter the propensity score estimation.
If not specified, variables in indepvars are used.
This option is useful if one wants to balance a different set of covariates than the ones used as controls in the model.
This option must be specified if indepvars is empty.

probit indicates that the propensity score is computed after a fitting a [R] probit model; default is [R] logit.

nocomsup indicates that the sample is not to be restricted to the area of common support.

Model

firststage estimates the discontinuity in the treatment probability using OLS.

reducedform estimates the reduced form effect using OLS.

ivregress estimates the treatment effect using instrumental variable regression.
If specified, it requires that a treatment variable is also specified in treatment(varname).
See ivregress for additional information.

quadratic indicates that a quadratic spline is to be used for full interaction with subgroup indicators. If not specified, a linear spline is used.

vce(vcetype) specifies the variance estimators options.
vcetype may be unadjusted, robust, cluster clustvar, bootstrap, jackknife, or hac kernel (see vce_option).
Bootstrap is used by default, unless nobootstrap is used (see below), or a different vcetype is specified.

rddsga computes the bootstrap estimate of the variance-covariance matrix by taking a random sample (with replacement) of size N from the observations and computing the estimate as usual.
This process is repeated the number of times specied in bsreps(#) (see below), which yields a bootstrap distribution of estimates.
See Methods and formulas in [R] bootstrap for further details.

Confidence intervals and p-values are estimated using the percentile method by default. See the normal option below for further details and other options.

bsreps(#) perform # bootstrap replications; default is bsreps(50).

normal computes and report normal-based p-values and confidence intervals.
By default rddsga uses the so-called percentile method, which means we compute the empirical p-value, i.e. the proportion of bootstrap estimates further in the tails than the (absolute value of the) original estimate.
The percentile method yields nonparametric confidence intervals that correspond to the pth quantile of the bootstrap distribution.
See Methods and formulas in [R] bootstrap for further details.

If normal is specified, p-values are obtained using the normality assumption, which yields confidence intervals that correspond to the pth quantile of the standard normal distribution.

nobootstrap prevents computing bootstrap standard errors, which is the default.

noipsw prevents employing inverse propensity score weighting for the estimations.

Reporting

dibalance display original balance and propensity score weighting balance tables and statistics.
This balance is computed for each covariate in indepvars, unless balance(varlist) is specified.

psweight(newvar) specifies a name for a new variable with the propensity score weighting. If not specified, no variable will be generated.

comsup(newvar) specifies a name for a new binary variable indicating common support. If not specified, no variable will be generated.

pscore(newvar) specifies a name for a new variable with the propensity score. If not specified, no variable will be generated.

Examples

Setup (click here for details on getting ancillary files)

. use rddsga_synth

Assess covariate imbalance using one covariate

. rddsga Y X, balance(W1) sgroup(G) bwidth(10) dibal

Silently store computed IPSW based on X1 and X2

. rddsga Y X, balance(W1 W2) sgroup(G) bwidth(10) ipsweight(ipsw)

Fit reduced form model

. rddsga Y X, balance(W1 W2) sgroup(G) bwidth(10) reduced

Estimate treatment effect in fuzzy RDD using instrumental variables regression and 200 bootstrap replications, comparing output without and with IPSW

. rddsga Y X W1 W2, sgroup(G) bwidth(6) ivreg bsreps(100) treatment(D) noipsw

. rddsga Y X W1 W2, sgroup(G) bwidth(6) ivreg bsreps(100) treatment(D)

Stored results

rddsga stores the following in e():

Scalars

e(ipsw_N_G0) number of observations in subgroup 0 (IPSW)

e(ipsw_N_G1) number of observations in subgroup 1 (IPSW)

e(ipsw_Fstat) F-statistic (IPSW)

e(ipsw_pvalue) F-statistic p-value (IPSW)

e(ipsw_avgdiff) Average of absolute values of standardized differences (IPSW)

e(unw_N_G0) number of observations in subgroup 0 (unweighted)

e(unw_N_G1) number of observations in subgroup 1 (unweighted)

e(unw_Fstat) F-statistic (unweighted)

e(unw_pvalue) F-statistic p-value (unweighted)

e(unw_avgdiff) Average of absolute values of standardized differences (unweighted)

Matrices

e(b) subgroup estimators coefficient vector

e(V) variance-covariance matrix of the estimators

e(ipsw) balance table matrix (IPSW)

e(unw) balance table matrix (unweighted)

Additionally, rddsga stores all macros and scalars of the estimated model (firststage, firststage or ivregress; see Model options above).
Refer to the Stored Results section of [R] regress for the full list of macros and scalars additionally stored in e().

Authors

Alvaro Carril (maintainer)

J-PAL LAC

acarril@fen.uchile.cl

Andre Cazor

J-PAL LAC

Maria Paula Gerardino

Inter-American Development Bank

Stephan Litschig

National Graduate Institute for Policy Studies

Dina Pomeranz

University of Zurich

Disclaimer

This software is provided "as is", without warranty of any kind.
If you have suggestions or want to report problems, please create a new issue in the project repository or contact the project maintainer.
All remaining errors are our own.

References

Gerardino, Maria Paula, Stephan Litschig, and Dina Pomeranz. "Can Audits Backfire? Evidence from Public Procurement in Chile." Working Paper. National Bureau of Economic Research, October 2017. http://www.nber.org/papers/w23978.