nonlinear_aggte: Aggregate ATT(g,t) Estimates for Nonlinear DiD

View source: R/aggregate.R

nonlinear_aggteR Documentation

Aggregate ATT(g,t) Estimates for Nonlinear DiD

Description

Aggregates the group-time average treatment effects from nonlinear_attgt into interpretable summary parameters. Provides event-study (dynamic), group-level, calendar-time, and overall ATT aggregations - each appropriate for nonlinear settings.

Usage

nonlinear_aggte(
  obj,
  type = c("dynamic", "group", "calendar", "simple"),
  na.rm = TRUE,
  min_periods = 1L,
  weights = c("equal", "sample")
)

Arguments

obj

An object of class nonlinear_attgt from nonlinear_attgt.

type

Character. The aggregation type:

  • "dynamic": Event-study / dynamic treatment effects. Averages ATT(g,t) across groups g for each relative time e = t - g.

  • "group": Group-specific ATT. Averages over post-treatment periods within each treated cohort g.

  • "calendar": Calendar-time ATT. Averages over groups for each calendar time t.

  • "simple": Overall average ATT, weighted by cohort size.

na.rm

Logical. Remove NA ATT(g,t) estimates. Default TRUE.

min_periods

Integer. Minimum number of ATT(g,t) observations required for an aggregated estimate to be reported. Default 1.

weights

Character. Weighting scheme for aggregation:

  • "equal": Equal-weight across (g,t) cells (default).

  • "sample": Weight by treated sample size in each (g,t).

Value

An object of class nonlinear_aggte with slots:

agg

Data frame with aggregated ATT, SE, and CI.

type

The aggregation type used.

overall_att

Scalar overall ATT estimate.

overall_se

SE for overall ATT.

Examples


set.seed(1)
dat  <- sim_binary_panel(n = 400, nperiods = 8, prop_treated = 0.5)
res  <- nonlinear_attgt(dat, yname = "y", tname = "period",
                         idname = "id", gname = "g",
                         outcome_model = "logit")
agg  <- nonlinear_aggte(res, type = "dynamic")
plot(agg)



NonlinearDiD documentation built on May 6, 2026, 1:06 a.m.