Skip to contents

A difference-in-differences within each of two groups, then the difference between them.

Usage

morie_causal_did_three_way(y, treated, post, group)

Arguments

y

outcome.

treated

0/1 treated indicator.

post

0/1 post-period indicator.

group

0/1 eligible-group indicator.

Value

list with ddd, did_eligible, did_placebo, cell_means, se, z, p_value.

Details

The point is to relax parallel trends: DiD needs the trend to be the same across arms, while DDD only needs the VIOLATION of parallel trends to be common to both groups. That is weaker, not absent – inspect did_placebo, because a large value means the third difference is doing heavy lifting and the identifying assumption has moved rather than gone away.

References

Gruber, J. (1994). The incidence of mandated maternity benefits. American Economic Review, 84(3), 622-641.

Examples

set.seed(1)
n <- 400
g <- rbinom(n, 1, 0.5)
tt <- rbinom(n, 1, 0.5)
p <- rbinom(n, 1, 0.5)
y <- 1 + g + tt + p + 2 * g * tt * p + rnorm(n)
round(morie_causal_did_three_way(y, tt, p, g)$ddd, 2)
#> [1] 1.93