% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/causal.R
\name{cqte.causalmixgpd_causal_fit}
\alias{cqte.causalmixgpd_causal_fit}
\alias{cqte}
\title{Conditional quantile treatment effects}
\usage{
\method{cqte}{causalmixgpd_causal_fit}(
  fit,
  probs = c(0.1, 0.5, 0.9),
  newdata = NULL,
  interval = "credible",
  level = 0.95,
  show_progress = TRUE
)
}
\arguments{
\item{fit}{A \code{"causalmixgpd_causal_fit"} object from \code{run_mcmc_causal()}.}

\item{probs}{Numeric vector of probabilities in (0, 1) specifying the quantile levels
of the outcome distribution to estimate treatment effects at.}

\item{newdata}{Optional data.frame or matrix of covariates for prediction.
If \code{NULL}, uses the training covariates stored in \code{fit}.}

\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{show_progress}{Logical; if TRUE, print step messages and render progress where supported.}
}
\value{
An object of class \code{"causalmixgpd_qte"} containing the CQTE
summary, the probability grid, and the treated/control prediction objects
used to construct the effect. The returned object includes a top-level
\code{$fit_df} data frame for direct extraction.
}
\description{
\code{cqte()} evaluates treated-minus-control predictive quantiles at
user-supplied covariate rows.
}
\details{
For each prediction row \eqn{x}, the conditional quantile treatment effect is
\deqn{\mathrm{CQTE}(\tau, x) = Q_1(\tau \mid x) -
Q_0(\tau \mid x).}

This estimand is available only for conditional causal models with
covariates. For marginal quantile contrasts over the empirical covariate
distribution, use \code{\link{qte}} or \code{\link{qtt}}.

If the fit includes a PS block, the same PS adjustment is applied to both arm
predictions before differencing.
}
\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)
cqte(fit, probs = c(0.5, 0.9), newdata = X[1:5, , drop = FALSE])
cqte(fit, probs = c(0.5, 0.9), interval = "credible", level = 0.90)  # 90\% CI
cqte(fit, probs = c(0.5, 0.9), interval = "hpd")  # HPD intervals
cqte(fit, probs = c(0.5, 0.9), interval = NULL)   # No intervals
}
}
\seealso{
\code{\link{qte}}, \code{\link{qtt}}, \code{\link{cate}},
\code{\link{predict.causalmixgpd_causal_fit}}.
}
