% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/aggregate.R
\name{nonlinear_aggte}
\alias{nonlinear_aggte}
\title{Aggregate ATT(g,t) Estimates for Nonlinear DiD}
\usage{
nonlinear_aggte(
  obj,
  type = c("dynamic", "group", "calendar", "simple"),
  na.rm = TRUE,
  min_periods = 1L,
  weights = c("equal", "sample")
)
}
\arguments{
\item{obj}{An object of class \code{nonlinear_attgt} from
\code{\link{nonlinear_attgt}}.}

\item{type}{Character. The aggregation type:
\itemize{
  \item \code{"dynamic"}: Event-study / dynamic treatment effects.
    Averages ATT(g,t) across groups g for each relative time e = t - g.
  \item \code{"group"}: Group-specific ATT. Averages over post-treatment
    periods within each treated cohort g.
  \item \code{"calendar"}: Calendar-time ATT. Averages over groups for
    each calendar time t.
  \item \code{"simple"}: Overall average ATT, weighted by cohort size.
}}

\item{na.rm}{Logical. Remove NA ATT(g,t) estimates. Default TRUE.}

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

\item{weights}{Character. Weighting scheme for aggregation:
\itemize{
  \item \code{"equal"}: Equal-weight across (g,t) cells (default).
  \item \code{"sample"}: Weight by treated sample size in each (g,t).
}}
}
\value{
An object of class \code{nonlinear_aggte} with slots:
  \describe{
    \item{agg}{Data frame with aggregated ATT, SE, and CI.}
    \item{type}{The aggregation type used.}
    \item{overall_att}{Scalar overall ATT estimate.}
    \item{overall_se}{SE for overall ATT.}
  }
}
\description{
Aggregates the group-time average treatment effects from
\code{\link{nonlinear_attgt}} into interpretable summary parameters.
Provides event-study (dynamic), group-level, calendar-time, and
overall ATT aggregations - each appropriate for nonlinear settings.
}
\examples{
\donttest{
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)

}
}
