Skip to contents

The overall, event-study, cohort and calendar-time aggregations of Callaway and Sant'Anna (2021), Sec. 4. Standard errors come from the influence functions of the constituent cells, so they account for the estimation of every cell that enters an aggregate.

Usage

morie_aggregateatt(gt, g, n_units, weights_by = "cohort_size")

Arguments

gt

Cell list from morie_grouptimeatt.

g

First treated period index per unit.

n_units

Number of units.

weights_by

"cohort_size" (default) weights post- treatment cells by cohort size; "equal" weights them equally. Both routes are kept.

Value

A list with overall, overall_se, event, cohort and calendar, or an empty list if no cell is post-treatment.

References

Callaway, B. and Sant'Anna, P. H. C. (2021). Journal of Econometrics, 225(2), 200-230, Section 4.

Examples

set.seed(17)
nu <- 30; Tn <- 5
g <- rep(c(3, 4, Inf), each = 10)
Y <- matrix(rnorm(nu * Tn), nu, Tn)
for (i in seq_len(nu)) if (is.finite(g[i])) Y[i, g[i]:Tn] <- Y[i, g[i]:Tn] + 1
gt <- morie_grouptimeatt(Y, g)
morie_aggregateatt(gt, g, n_units = nu)$overall
#> [1] -0.6925902