| ddid | R Documentation |
Computes Quantile Treatment effects on the Treated (QTT) and
the Average Treatment Effect on the Treated (ATT) using the distributional
DiD identification strategy of Callaway, Li, and Oka (2018). Handles
two-period data and staggered treatment adoption uniformly via
ptetools. Requires panel data.
Identification. Under distributional parallel trends and a copula
restriction (the rank correlation of untreated potential outcomes between
the treated and control groups in the pre-period is preserved), the
counterfactual distribution F_{Y(0),\text{post}|D=1} is recovered
by adding each control unit's actual change \Delta Y_{\text{ctrl},j}
to the treated pre-period quantile at that control unit's rank. This
point-identifies the QTT with only two time periods, in contrast to
methods (e.g. panel_qtt) that require three periods.
Panel data required. Unlike cic, qdid, and
mdid, this estimator cannot be applied to repeated cross sections
because it requires observing the within-unit outcome change for each
control unit.
ddid(
yname,
gname,
tname,
idname,
data,
xformula = ~1,
weightsname = NULL,
control_group = "notyettreated",
anticipation = 0,
alp = 0.05,
cband = TRUE,
biters = 100,
cl = 1,
gt_type = "att",
probs = NULL
)
yname |
Name of the outcome variable in |
gname |
Name of the treatment group variable (first treatment period; 0 for never-treated units). |
tname |
Name of the time period variable. |
idname |
Name of the unit id variable (required). |
data |
A data frame. |
xformula |
One-sided formula for covariates. Default |
weightsname |
Name of the column in |
control_group |
Which units to use as the comparison group:
|
anticipation |
Number of periods of anticipation. Default |
alp |
Significance level for confidence bands. Default |
cband |
Logical; if |
biters |
Number of bootstrap iterations. Default |
cl |
Number of clusters for parallel computation. Default |
gt_type |
Type of group-time effect to compute. |
probs |
For |
For gt_type = "att", a pte_results object from
ptetools. For gt_type = "qtt", a pte_qtt object.
Callaway, Brantly, Tong Li, and Tatsushi Oka. “Quantile Treatment Effects in Difference in Differences Models under Dependence Restrictions and with Only Two Time Periods.” Journal of Econometrics 206(2), pp. 395-413, 2018.
data(mpdta, package = "did")
## ATT aggregated across all groups and periods
res_att <- ddid(yname = "lemp", gname = "first.treat", tname = "year",
idname = "countyreal", data = mpdta,
gt_type = "att", biters = 20)
summary(res_att)
## Full QTT curve at selected quantiles
res_qtt <- ddid(yname = "lemp", gname = "first.treat", tname = "year",
idname = "countyreal", data = mpdta,
gt_type = "qtt", probs = seq(0.1, 0.9, 0.1), biters = 20)
summary(res_qtt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.