Title

cic -- Stata implementation of the Athey and Imbens (2006) Changes-in-Changes model

Syntax

. cic estimator
depvar
tvar
pvar
[varlist]
[if] [in]
[weight]
[,
options]

depvar is the dependent variable

tvar must contain values 0 or 1, representing the treatment (1) and comparison (0) groups.

pvar must contain values 0 or 1, representing the pre-intervention (0) and post-intervention (1) periods.

varlist is a (optional) list of covariates variables (see the remarks)

estimator

continuous CIC estimator with continuous outcomes (Athey and Imbens 2006, equation 9)

dci CIC model with discrete outcomes, under the conditional independence assumption
(Athey and Imbens 2006, equation 29)

bounds lower and upper bound estimates of discrete CIC model, without conditional independence
(Athey and Imbens 2006, equation 25)

all all of the above

Main
at(numlist) a list of percentiles for CIC results. default is at(10(10)90)

vce(vcetype) vce(none), vce(delta), or vce(bootstrap [, bsopts]) are allowed;
default is vce(none)

did calculates traditional DID and quantile DID estimates;
by default this option is off, unless varlist exists in which case it is turned on

untreated estimates the counterfactual effect of the policy for the untreated group
(Athey and Imbens 2006, Setion 3.2)

round(#) rounds depvar to # units (=0 for no rounding, the default);
any rounding is performed after adjusting for covariates, if applicable

Reporting
level(#) set confidence level; default is level(95)

notable suppresses the table of results

noheader suppresses the table header

nolegend suppresses the table legend

display_options control columns and
column formats, row spacing, line width, display of omitted variables and base and empty
cells, and factor-variable labeling

varlist may contain factor variables; see fvvarlists.

bootstrap:, by:, jackknife:, and statsby: are allowed;

Weights are not allowed with the bootstrap: prefix.

fweights, iweights, and aweights are allowed; see weight.

When the by prefix is used, only the last group is saved in ereturn.

display_options include: noomitted, vsquish, noemptycells, baselevels, and allbaselevels;
see [R] estimation options.

bsopts

reps(#) perform # bootstrap replications; default is 1000

saving(filename[,replace]) save bootstrap results to filename (optionally,
replace specifies that filename be overwritten, if it exists.)

sepercentile obtain bootstrap standard errors from percentiles of bootstrap
estimates instead of using Stata's default method. standard error = (p(97.5) - p(2.5)) / (2*1.96), where p(N)
is Nth percentile of bootstrap iterations (this is the method used in Athey and Imbens' MATLAB code)

accel(vector) acceleration values for each statistic

mse use MSE formula for variance estimation

nodots suppress the replication dots

size(#) draw samples of size #

vce(bootstrap[, bsopts]) stratifies the sample by tvar and pvar

See bootstrap postestimation for features available after estimation.

The following two lines are equivalent:

. cic y treat post, vce(bootstrap, [bsopts])

. bootstrap _b, strata(treat post) [bsopts]: cic y treat post, vce(none)

However, the second line is slower because vce(bootstrap) is implemented in Mata and runs with less overhead.
However, the bootstrap prefix is more flexible due the availability of size(), strata(), cluster(), idcluster() and other options.

CIC also appears to works with the svy bootstrap: prefix, but you will need to use svyset to set
up the bsrweight() variables, PSUs, weights and strata before calling CIC.

The sample size for size(#) is defined as follows:
without weights, the sample in each group is calculated as the number of observations in the group;
with fweights, the sample in each group is calculated as the sum of the fweights for observations in the group;
with iweights, the sample in each group is calculated as the sum of the iweights for observations in the group,
divided by the sum of the weights for all observations, and multiplied by the value specified in size()
(rounded to the nearest integer -- by default, size()==the sum of the iweights);
with aweights, the weights are normalized to mean 1. then, the sample in each group is calculated as the sum
of the weights for observations in the group (rounded to the nearest integer).
This sub-option is allowed only with pweights, aweights, and iweights. With unweighted samples,
you could generate a variable equal to one and use it as an iweight.

Description

This Stata command, cic, implements the changes-in-changes (CIC) model proposed by Athey and Imbens (2006).
The command estimates the average and quantile treatment effects of a treatment in settings where
repeated cross sections of individuals are observed in a treatment group and a control group, before and after the treatment.
The CIC model relaxes several assumptions of the standard linear difference-in-differences model.
Both the continuous CIC model and discrete CIC model (with and without a conditional independence assumption)
are included in the cic command, as are treatment effects from
standard linear difference-in-differences model and a quantile difference-in-differences model.
By implementing the CIC estimator alongside these other two pre-existing estimators,
the cic command can illustrate how the effect the treatment varies across a variety of assumptions.

Remarks

I wrote the code for this Stata implementation for one of my dissertation projects (Kranker 2011, 2016).
The code started as a simple "port" of Athey and Imbens' Matlab code.
Then I made some changes to the code to speed it up in various ways and extend the methods.

While was rummaging through some old files in June 2019,
I ran across this code, thought it might be helpful to others, and decided to post the package online.
I see Blaise Melley also has his own version of the model for Stata.
Let's hope this release prevents yet another person from doing this work!

The use of difference-in-differences (DID) methods is widespread in program evaluation and empirical
economics (Imbens and Wooldridge 2009). DID methods involve comparing outcomes between two groups across two time periods,
where only one of the two groups are exposed to the intervention in one of the periods.
The DID estimator calculates the difference in outcomes between the treatment and comparison groups after the intervention began,
minus the difference in outcomes between the treatment and comparison groups before the intervention began.
Or, equivalently, the DID estimator can be seen as the change in outcomes for the treatment group
before and after the intervention, minus the change in outcomes for the comparison group over the same time period.
It is straightforward to generalize this basic two group, two period DID model has been generalized in various ways—for example,
to adjust for observed covariates, include more than two groups, or include more than two time periods.

Athey and Imbens (2006) proposed a changes-in-changes (CIC) model which generalizes the DID model by relaxing relaxes several assumptions.
(Thus the standard DID model is nested in the CIC model as a special case.)
The CIC model estimates the entire distribution of outcomes under the counterfactual,
allowing one to calculate average treatment effects or estimate effects at specific quantiles.

This Stata command, cic, implements the CIC estimator from Athey and Imbens (2006).
cic is written in Mata with an effort to maximize parallel computing; in tests (not shown),
I found cic estimated the model more quickly than the Matlab code previously distributed by Athey and Imbens.
The cic command also offers several previously unavailable features (e.g., to allow for covariates).
In addition, you can use Stata's bootstrap: prefix, which offers more flexibility for
computing bootstrapped standard errors (e.g., strata, blocks).

Imbens and Wooldridge (2009) provide a nice, short overview of the method.
Athey and Imbens (2006) explain their methods (with proofs) in a fairly long and complicated article.
The appendix is also quite helpful.

Covaraiates are implemented according to the parametric approach outlined by Athey and Imbens (2006):
"... apply the CIC estimator to the residuals from an ordinary least squares regression
with the effects of the dummy variables added back in." (p. 466)

Examples

Setup

. sysuse nlsw88, clear

. set seed 1

. gen TREAT = uniform() < .5

. replace wage = wage + TREAT

. gen POST = uniform() < .5

. replace wage = wage - POST

Estimate

. cic continuous wage TREAT POST, vce(bootstrap, reps(50))

. bootstrap, reps(50): cic all wage TREAT POST, at(50 90) did vce(none)

. cic all wage TREAT POST, vce(delta) at(50)

. cic dci wage TREAT POST i.occupation, at(50) vce(bootstrap, reps(50))

Author

Stata code by Keith Kranker

Based on Matlab code by Susan Athey & Guido W. Imbens,
available at https://athey.people.stanford.edu/research

References

Athey, Susan and Guido W. Imbens. "Identification and Inference in Nonlinear Difference-in-Differences Models."
*Econometrica*, vol. 74, no. 2, March 2006, pp. 431-497. (http://dx.doi.org/10.1111/j.1468-0262.2006.00668.x)

Imbens, Guido W. and Jeffery M. Wooldridge. "Recent Developments in the Econometrics of Program Evaluation."
*Journal of Economic Literature*, vol. 47, no. 1, 2009, pp. 5–86. (http://dx.doi.org/10.1257/jel.47.1.5)

Kranker, Keith. "The Effect of Disease Management Programs on Medicaid Expenditures."
Doctoral dissertation. College Park, MD: University of Maryland, 2011. (http://hdl.handle.net/1903/12101)

Kranker, Keith. "Effects of Medicaid Disease Management Programs on Medical Expenditures: Evidence from a Natural Experiment in Georgia."
*Journal of Health Economics*, vol. 46, March 2016, pp. 52-69.
(http://dx.doi.org/10.1016/j.jhealeco.2016.01.008)