Returns a tidy data frame of the aggregated ATT estimates from a
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. 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 byatt().- 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{
res <- att(y ~ D | id + year, data = df, time = year,
estimator = "cs", aggregation = "by_cohort")
broom::tidy(res)
# Compare estimators in one table:
twfe <- did(y ~ D | id + year, data = df)
cs <- att(y ~ D | id + year, data = df, time = year, estimator = "cs")
bjs <- att(y ~ D | id + year, data = df, time = year, estimator = "bjs")
modelsummary::modelsummary(list(TWFE = twfe, CS = cs, BJS = bjs))
} # }