*! version 1 2018-07-27

Title

fuzzydid -- Estimation with Fuzzy Difference-in-Difference Designs.

Syntax

fuzzydid Y G T D [if] [in]
[,
did
tc
cic
lqte
newcateg(numlist)
numerator
partial
nose
cluster(varname)
breps(#)
eqtest
continuous(varlist)
qualitative(varlist)
modelx(reg1 reg2 reg3)
sieves
sieveorder(#)
tagobs
]

Description

fuzzydid computes estimators of local average and quantile treatement effects in fuzzy DID designs, following de Chaisemartin and D'Haultfoeuille (2018a).
It also computes their standard errors and confidence intervals.

Y is the outcome variable.

G is the group variable(s). We refer to Section 4.2 of de Chaisemartin et al. (2018b) for more details on how to construct this/these variable(s).

T is the time period variable.

D is the treatment variable. It can be any ordered variable.

A detailed introduction to this command is given in de Chaisemartin et al. (2018b).

Options

did computes the Wald-DID estimator.

tc computes the Wald-TC estimator.

cic computes the Wald-CIC estimator. This option can only be specified when no covariates are included in the estimation.

lqte computes the estimators of the LQTE for quantiles of order 5%, 10%,..., 95%. This option can only be specified when D, G, and T are
binary, and no covariates are included in the estimation.

At least one of the four options above must be specified. If several of these options are specified, the command computes all the estimators requested by the user.

newcateg(numlist) groups some values of the treatment together when estimating the Wald-TC and Wald-CIC. This option may be useful when the treatment takes a large number of values,
as explained in Section 3.3 of de Chaisemartin et al. (2018b). The user needs to specify the upper bound of
each set of values of the treatment she wants to group. For instance, if D takes the values 0,1,2,3,4.5,7,8, and she wants to group together units with D in {0,1,2}, D in {3,4.5}, and D in {7,8}, she needs
to write newcateg(2 4.5 8).

numerator computes only the numerators of the Wald-DID, Wald-TC and Wald-CIC estimators. As explained in Section 3.3.3 in the supplement of de Chaisemartin and D'Haultfoeuille (2018a), this option
is useful to conduct placebo tests of the assumptions underlying each estimator.

partial computes the bounds on the local average treatment effects in the absence of a "stable" control group. This option can only be specified when no covariates are included in the estimation.

nose computes only the estimators, not their standard errors.

cluster(varname) computes the standard errors of the estimators using a block bootstrap at the varname level. Only one clustering variable is allowed.

breps(#) specifies the number of bootstrap replications. The default is 50.

eqtest performs an equality test between the estimands, when the user specifies at least two of the did, tc, and cic options.

tagobs creates a new variable named tagobs which identifies the observations used by fuzzydid.

Options specific to estimators with covariates

continuous(varlist) specifies the names of all the continuous covariates that need to be included in the estimation.

qualitative(varlist) specifies the names of all the qualitative covariates that need to be included in the estimation. For each variable, indicator variables are created for each value except one, and
included as controls in the estimation.

modelx(reg1 reg2 reg3) specifies which parametric method should be used to estimate the conditional expectations in the Wald-DID or Wald-TC estimators with covariates. reg1 specifies
which method should be used to estimate E(Y_|X) and E(Y_|X). reg2 specifies which method should be used to estimate E(D_|X). When D is not binary, reg3 specifies which method should be used
to estimate P(D_=d|X) for all possible values of d. The possible methods are: ols, logit, and probit. For instance, if the user writes modelx(ols logit logit), the command estimates
E(Y_|X) and E(Y_|X) by OLS, and E(D_|X) and P(D_=d|X) by a logistic regession. The logit and probit options can only be used with binary variables.

sieves indicates that the conditional expectations in the Wald-DID and Wald-TC with covariates should be estimated nonparametrically.

When covariates are included in the estimation, and neither modelx nor sieves is specified, the command estimates by default all conditional expectations by OLS.

sieveorder(#) specifies the order of the sieve basis, when the option sieves is used. It must be greater than or equal to 2, and the command does not allow for more than min(4800, n/5)
basis functions, where n is the number of observations. If this option is not specified, the choice of the sieve order is done via 5-fold cross-validation with a mean squared error loss function.

Example: data from Gentzkow, Shapiro, and Sinkinson (2011)

. use turnout_dailies_1868-1928.dta

. gen G1872=(fd_numdailies>0)-(fd_numdailies<0) if (year==1872)&fd_numdailies!=.&sample==1

. sort cnty90 year

. replace G1872=G1872[_n+1] if cnty90==cnty90[_n+1]&year==1868

. fuzzydid pres_turnout G1872 year numdailies, did tc cic newcateg(0 1 2 45) breps(200) cluster(cnty90)

Saved results

In what follows, let k denote the number of options specified among did, tc and cic. fuzzydid saves the following in e():

Scalar

e(N) number of observations used in the estimation.

Matrices

e(b_LATE) a k x 1 matrix where each line corresponds to the value of one of the requested estimators.

e(se_LATE) a k x 1 matrix where each line corresponds to the bootstrap standard errors associated to one of the requested estimators.

e(ci_LATE) a k x 2 matrix whose columns respectively store the lower and upper bounds of the 95% confidence interval computed by percentile bootstrap for each requested estimator.

e(b_LATE_eqtest) a "k choose 2" x 1 matrix which stores the value of the difference between each pair of requested estimators.

e(se_LATE_eqtest) a "k choose 2" x 1 matrix which stores the bootstrap standard errors associated to the difference between each pair of requested estimators.

e(ci_LATE_eqtest) a "k choose 2" x 2 matrix whose columns respectively store the lower and upper bounds of the 95% confidence interval computed by percentile bootstrap for the difference between each pair of requested estimators.

e(b_LQTE) a 19 x 1 matrix which stores the value of the LQTE estimator at the 5th, 10th,...,95th percentile.

e(se_LQTE) a 19 x 1 matrix which stores the bootstrap standard errors associated to the 19 LQTE estimators.

e(ci_LATE) a 19 x 2 matrix whose columns respectively store the lower and upper bounds of the 95% confidence interval computed by percentile bootstrap for each LQTE estimator.

References

de Chaisemartin, C. and D'Haultfoeuille,X. 2018a.
Fuzzy Differences-in-Differences.
Review of Economic Studies, 85 (2): 999-1028.

de Chaisemartin, C. and D'Haultfoeuille, X. and Guyonvarch, Y. 2018b.
Fuzzy Differences-in-Differences with Stata.
Forthcoming in the Stata Journal.

Gentzkow, M. and Shapiro, J. and Sinkinson, M. 2011.
The Effect of Newspaper Entry and Exit on Electoral Politics.
American Economic Review 101.7 (2011): 2980-3018.

Authors

Clément de Chaisemartin, University of California at Santa Barbara, Santa Barbara, California, USA.
clementdechaisemartin@ucsb.edu.

Xavier D'Haultfoeuille, CREST, Palaiseau, France.
xavier.dhaultfoeuille@ensae.fr.

Yannick Guyonvarch, CREST, Palaiseau, France.
yannick.guyonvarch@ensae.fr.