Skip to contents

Combines a propensity score with an outcome regression fitted on the comparison group, so the estimator stays consistent if either working model is correct, not necessarily both. Parallel trends is still assumed, now conditional on the covariates.

Usage

morie_dr_did(y_pre, y_post, d, x, trim = 0.995, alpha = 0.05)

Arguments

y_pre, y_post

Outcome before and after, same units in order.

d

Binary treatment indicator.

x

Covariate matrix; a vector is one column.

trim

Upper bound on the fitted propensity score.

alpha

Significance level.

Value

Named list with att, se, ci_low, ci_high, statistic, p_value, n_trimmed, ps_min, ps_max, method.

Details

Extreme propensity scores are the practical failure mode, since the odds weight explodes as the score approaches one; scores are trimmed and the count reported rather than hidden. Standard errors come from the influence function, so the weighting is accounted for.

Mirrors morie.fn.aiptdd.

References

Sant'Anna PHC & Zhao J (2020). Doubly robust difference-in-differences estimators. Journal of Econometrics, 219(1), 101-122.

Examples

set.seed(1)
n <- 400
xx <- rnorm(n)
d <- rbinom(n, 1, plogis(0.8 * xx))
u <- rnorm(n, 0, 2)
morie_dr_did(u + rnorm(n), u + 0.9 * xx + 2 * d + rnorm(n), d, xx)$att
#> [1] 2.079019