help tvdiff

Title

tvdiff - Pre- and post-treatment estimation of the Average Treatment Effect (ATE) with binary time-varying treatment

Syntax

tvdiff
outcome
treatment
[varlist]
[if] [in]
[weight],
model(modeltype)
pre(#)
post(#)
[test_tt
graph
save_graph(graphname)
vce(vcetype)]

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

Description

tvdiff estimates Average Treatment Effects (ATEs) when the treatment is binary and varying over time. Using tvdiff, the user can estimate
the pre- and post-intervention effects by selecting the pre and post intervention periods, also by
plotting the results in a easy-to-read graphical representation. In order to assess the reliability of the causal results achieved by
the user's specified model, tvdiff allows to test the "common trend" assumption
either via a joint test on leads significance, or via a time-trend significance test. The model estimated by tvdiff is a generalization of the Difference-In-Differences (DID) approach to the
case of many post- and pre-intervention times.

According to the tvdiff syntax:

outcome: is the target variable over which measuring the impact of the treatment

treatment: is the binary treatment variable taking 1 for treated, and 0 for untreated units

varlist: is the set of pre-treatment (or observable confounding) variables

Options

model(modeltype) specifies the estimation model,
where modeltype must be one out of these two alternatives:
"fe" (fixed effects), or "ols" (ordinary least squares). It is always required to specify one model.

pre(#) allows to specify the number (#) of pre-treatment periods.

post(#) allows to specify the number (#) of post-treatment periods.

test_tt allows for performing the parallel–trend test using the time–trend approach.
The default is to use the leads.

graph allows for a graphical representation of results. It uses the coefplot command
implemented by Jann (2014).

vce(vcetype) allows for robust and clustered regression standard errors in model's estimates.

modeltype_options

Model
ols The model is estimated by ordinary least squares

fe The model is estimated by fixed-effects panel regression

tvdiff creates a number of variables:

_D_L1, _D_L2, ..., _D_Lm: are the lags of the treatment variable, with m equal to # in the post(#) option.

_D_F1, _D_F2, ..., _D_Fp: are the leads of the treatment variable, with p equal to # in the pre(#) option.

tvdiff returns the following scalars:

e(N) is the total number of (used) observations.

e(N1) is the number of (used) treated units.

e(N0) is the number of (used) untreated units.

e(ate) is the value of the (contemporaneous) Average Treatment Effect.

Remarks

- The treatment has to be a 0/1 binary variable (1 = treated, 0 = untreated).

- Before running tvdiff, check that coefplot is installed, or install it by typing:

. ssc install coefplot

- It is assumed that the model is correctly specified.

- Please remember to use the update query command before running
this program to make sure you have an up-to-date version of Stata installed.

Examples

*** SIMULATED DATA ***
. clear
. set obs 5
. set seed 10101
. gen id=_n
. expand 50
. drop in 1/5
. bys id: gen time=_n+1999
. gen D=rbinomial(1,0.4)
. gen x1=rnormal(1,7)
. tsset id time
forvalues i=1/6{
gen L`i'_x=L`i'.x
}
. bys id: gen y0=5+1*x+ rnormal()
. bys id: gen y1=100+5*x+90*L1_x+90*L2_x+120*L3_x+100*L4_x+90*L5_x +90*L6_x + rnormal()
. gen A=6*x+rnormal()
. replace D=1 if A>=15
. replace D=0 if A<15
. gen y=y0+D*(y1-y0)
. tsset id time
. xi: tvdiff y D x , model(fe) pre(6) post(6) vce(robust) graph save_graph(mygraph)

References

Angrist J.D. and Pischke J.S. 2009. Mostly Harmless Econometrics: An Empiricist's Companion,
Princeton University Press.

Autor, D. 2003. Outsourcing at Will: The Contribution of Unjust Dismissal Doctrine to the Growth of Employment Outsourcing,
Journal of Labor Economics, 21(1).

Cerulli, G. 2015. Econometric Evaluation of Socio-Economic Programs: Theory and Applications,
Springer.

Jann, B. 2014. A new command for plotting regression coefficients and other estimates. 12th German Stata Users Group meeting,
Hamburg, June 13. (http://www.stata.com/meeting/germany14/abstracts/materials/de14_jann.pdf)

Authors

Giovanni Cerulli

IRCrES-CNR

Research Institute on Sustainable Economic Growth, National Research Council of Italy

E-mail: giovanni.cerulli@ircres.cnr.it

Marco Ventura

ISTAT

Methodological and Data Quality Division, Italian Statistics Office

E-mail: mventura@istat.it

Also see

Online: coefplot, teffects, ivtreatreg, ctreatreg