Returns a tidy data frame of the aggregated ATT estimates from a
calc_att() result, in the column format expected by
modelsummary::modelsummary() (and therefore renderable with
tinytable::tt()). This makes it easy to put overall, by-cohort, or
by-time ATTs into a publication table, and to stack several estimators
(e.g. run_did() TWFE, CS, and BJS) side by side in one table.
The term column is derived from the aggregation type so that rows align
across models:
aggregation = "simple"->"ATT"aggregation = "by_cohort"->"Cohort <g>"aggregation = "by_time"->"Time <t>"
Arguments
- x
An
att_resultobject returned bycalc_att().- conf.int
Logical; add
conf.low/conf.highcolumns? DefaultFALSE.- conf.level
Confidence level for
conf.int(normal approximation). Default0.95.- ...
Unused; for S3 generic compatibility.
Value
A data frame with columns term, estimate, std.error,
statistic, p.value (and optionally conf.low, conf.high).
Examples
if (FALSE) { # \dontrun{
att <- calc_att(df, outcome = y, time = year, timing = g, unit = id,
estimator = "cs", aggregation = "by_cohort")
broom::tidy(att)
# Compare estimators in one table:
twfe <- run_did(df, outcome = y, treatment = D, fe = ~ id + year)
cs <- calc_att(df, outcome = y, time = year, timing = g, unit = id,
estimator = "cs")
bjs <- calc_att(df, outcome = y, time = year, timing = g, unit = id,
estimator = "bjs")
modelsummary::modelsummary(list(TWFE = twfe, CS = cs, BJS = bjs))
} # }