Skip to contents

ate_rmean() is a convenience wrapper for restricted-mean treatment effects when the ordinary mean is unstable or undefined.

Usage

ate_rmean(
  fit,
  newdata = NULL,
  cutoff,
  interval = "credible",
  level = 0.95,
  nsim_mean = 200L,
  show_progress = TRUE
)

Arguments

fit

A "causalmixgpd_causal_fit" object from run_mcmc_causal().

newdata

Optional data.frame or matrix of covariates for prediction. If NULL, uses the training covariates stored in fit.

cutoff

Finite numeric cutoff for the restricted mean.

interval

Character or NULL; type of credible interval:

  • NULL: no interval

  • "credible" (default): equal-tailed quantile intervals

  • "hpd": highest posterior density intervals

level

Numeric credible level for intervals (default 0.95 for 95 percent CI).

nsim_mean

Number of posterior predictive draws used by simulation-based mean targets. Ignored for analytical ordinary means.

show_progress

Logical; if TRUE, print step messages and render progress where supported.

Value

A "causalmixgpd_ate" object computed via ate for unconditional fits or cate for conditional fits. The returned object includes a top-level $fit_df data frame for direct extraction.

Details

The restricted-mean estimand replaces \(Y(a)\) by \(\min\{Y(a), c\}\), so the contrast remains finite even when the fitted GPD tail implies \(\xi \ge 1\).

Examples

if (FALSE) { # \dontrun{
cb <- build_causal_bundle(y = y, X = X, A = A, backend = "sb", kernel = "normal",
                         GPD = TRUE, components = 6)
fit <- run_mcmc_causal(cb)
ate_rm <- ate_rmean(fit, cutoff = 10, interval = "credible")
} # }