% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bounds.R
\name{nonlinear_bounds}
\alias{nonlinear_bounds}
\title{Nonparametric Bounds for Binary Outcomes in Staggered DiD}
\usage{
nonlinear_bounds(
  data,
  yname,
  tname,
  idname,
  gname,
  xformla = ~1,
  control_group = c("nevertreated", "notyetreated"),
  bound_type = c("pt_only", "manski", "pt_monotone"),
  alpha = 0.05
)
}
\arguments{
\item{data}{A long-format panel data frame.}

\item{yname}{Character. Name of binary outcome variable (0/1).}

\item{tname}{Character. Name of time period column.}

\item{idname}{Character. Name of unit identifier.}

\item{gname}{Character. Name of treatment cohort column.}

\item{xformla}{One-sided formula for covariates. Default `~ 1`.}

\item{control_group}{Character. \code{"nevertreated"} (default) or
\code{"notyetreated"}.}

\item{bound_type}{Character. Type of bound:
\itemize{
  \item \code{"manski"}: No-assumptions Manski bounds (widest)
  \item \code{"pt_monotone"}: Tighten using parallel trends + monotone
    treatment response
  \item \code{"pt_only"}: Use only parallel trends restriction
}}

\item{alpha}{Numeric. Significance level for confidence intervals on bounds.}
}
\value{
A data frame of sharp bounds (\code{lb}, \code{ub}) for ATT(g,t),
  with bootstrap confidence intervals.
}
\description{
Computes sharp nonparametric bounds on the ATT for binary outcomes in
staggered difference-in-differences designs, following the partial
identification approach. These bounds require NO functional form
assumptions on the outcome model - only an assumption about the
direction or magnitude of selection.

The key insight for binary outcomes: Since Y is binary (0 or 1), the ATT is
bounded by:
  - Lower bound: counterfactual never exceeds observed (pessimistic)
  - Upper bound: counterfactual never falls below observed (optimistic)

Under a Manski-style no-assumptions bound, plus refinements using
the parallel trends assumption as a restriction.
}
\examples{
set.seed(5)
dat    <- sim_binary_panel(n = 300, nperiods = 6)
bounds <- nonlinear_bounds(dat, "y", "period", "id", "g")
print(bounds)

}
\references{
Manski, C. F. (1990). Nonparametric bounds on treatment effects.
*American Economic Review*, 80(2), 319-323.

Callaway, B. (2021). Bounds on distributional treatment effect
parameters. *Journal of Econometrics*, 222(2), 1084-1111.
}
