Skip to contents

Native stacking: fits a small library of propensity learners (logistic, logistic with squared terms, and rmorie's native random forest – a probability forest of 200 CART trees, mtry = \(\lfloor\sqrt p\rfloor\), minimum node size 10, the ranger probability-forest defaults – so the library is identical on every install), combines their cross-validated predictions by non-negative least squares on the CV log-loss surface (native NNLS via Lawson-Hanson active set), and converts the ensemble scores to estimand weights.

Usage

morie_weight_super(data, treatment, covariates, estimand = "ATE", n_folds = 5L)

Arguments

data

Data frame.

treatment

Binary treatment column (0/1).

covariates

Covariate column names.

estimand

"ATE" (default), "ATT", or "ATC".

n_folds

Cross-validation folds for the stacking weights.

Value

A morie_weight object; $learner_weights gives the ensemble coefficients.

References

van der Laan, Polley & Hubbard (2007).

Examples

set.seed(1)
d <- data.frame(t = rbinom(150, 1, 0.5), x1 = rnorm(150), x2 = rnorm(150))
morie_weight_super(d, "t", c("x1", "x2"))
#> morie_weight: SuperLearner (native NNLS stack) (estimand ATE)
#>   n = 150  ESS = 143.2  weight range [1.129, 4.048]