Skip to contents

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>"

Usage

# S3 method for class 'att_result'
tidy(x, conf.int = FALSE, conf.level = 0.95, ...)

Arguments

x

An att_result object returned by att().

conf.int

Logical; add conf.low/conf.high columns? Default FALSE.

conf.level

Confidence level for conf.int (normal approximation). Default 0.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))
} # }