% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/causal.R
\name{att}
\alias{att}
\title{Average treatment effects standardized to treated covariates}
\usage{
att(
  fit,
  newdata = NULL,
  y = NULL,
  type = c("mean", "rmean"),
  cutoff = NULL,
  interval = "credible",
  level = 0.95,
  nsim_mean = 200L,
  show_progress = TRUE
)
}
\arguments{
\item{fit}{A \code{"causalmixgpd_causal_fit"} object from \code{run_mcmc_causal()}.}

\item{newdata}{Ignored for marginal estimands. If supplied, a warning is issued
and training data are used.}

\item{y}{Ignored for marginal estimands. If supplied, a warning is issued
and training data are used.}

\item{type}{Character; type of mean treatment effect:
\itemize{
\item \code{"mean"} (default): ordinary mean ATE
\item \code{"rmean"}: restricted-mean ATE (requires \code{cutoff})
}}

\item{cutoff}{Finite numeric cutoff for restricted mean; required for
\code{type = "rmean"}, ignored otherwise.}

\item{interval}{Character or NULL; type of credible interval:
\itemize{
\item \code{NULL}: no interval
\item \code{"credible"} (default): equal-tailed quantile intervals
\item \code{"hpd"}: highest posterior density intervals
}}

\item{level}{Numeric credible level for intervals (default 0.95 for 95 percent CI).}

\item{nsim_mean}{Number of posterior predictive draws used by simulation-based
mean targets. Ignored for analytical ordinary means.}

\item{show_progress}{Logical; if TRUE, print step messages and render progress where supported.}
}
\value{
An object of class \code{"causalmixgpd_ate"} containing the ATT
summary, optional intervals, and the arm-specific predictive objects used
in the aggregation. The returned object includes a top-level
\code{$fit_df} data frame for direct extraction.
}
\description{
\code{att()} computes the average treatment effect on the treated.
}
\details{
The estimand is
\deqn{\mathrm{ATT} = E\{Y(1) - Y(0) \mid A = 1\},}
approximated by marginalizing over the empirical covariate distribution of
treated units.
}
\examples{
\donttest{
N <- 25
X <- data.frame(x1 = stats::rnorm(N))
A <- stats::rbinom(N, 1, 0.5)
y <- abs(stats::rnorm(N)) + 0.1
mcmc_small <- list(niter = 100, nburnin = 50, thin = 1, nchains = 1, seed = 1)
cb <- build_causal_bundle(y = y, X = X, A = A, backend = "sb", kernel = "normal",
                         components = 3, mcmc_outcome = mcmc_small, mcmc_ps = mcmc_small)
fit <- run_mcmc_causal(cb, show_progress = FALSE)
att(fit, interval = "credible", nsim_mean = 100)
}
}
\seealso{
\code{\link{ate}}, \code{\link{qtt}}, \code{\link{cate}}.
}
