Estimates the average treatment effect by weighting outcomes with the inverse of the estimated propensity score \(e(x) = P(T = 1 | X = x)\): $$\widehat{ATE} = \frac{1}{n} \sum_i \frac{T_i Y_i}{\hat e(X_i)} - \frac{1}{n} \sum_i \frac{(1 - T_i) Y_i}{1 - \hat e(X_i)}$$ The propensity score is estimated with any mlr3 classification learner.
ate_ipw(
data,
outcome = "y",
treatment = "t",
ps_learner,
covariates = NULL,
folds = 1,
ps_trim = NULL
)A data.frame with the outcome, treatment and covariates.
Name of the outcome column. Default "y".
Name of the binary (0/1) treatment column. Default "t".
An mlr3 classification learner used as the propensity
score model, e.g. mlr3::lrn("classif.log_reg"). Its predict type is
set to "prob" automatically.
Optional character vector of covariate columns. Defaults to all columns except the outcome and the treatment.
Number of cross-fitting folds for the propensity model.
1 (the default) fits and predicts in-sample; values greater than 1
use out-of-fold predictions, which reduces overfitting bias when using
flexible learners.
Optional trimming for the estimated propensity scores.
Either a single value a (clips to [a, 1 - a]) or a length-2 range.
NULL (default) applies no trimming.
An object of class "causalmlr_ate"; see ate_naive().