Estimates the probability of treatment via logistic regression or gradient boosting on a set of covariates. Both run natively.
Usage
morie_matching_estimate_propensity(
data,
treatment,
covariates,
model = "logistic",
max_iter = 1000
)Value
A numeric vector of propensity scores aligned to the rows of
data (after dropping NAs in treatment or
covariates); the names of the vector are the row names
of the retained rows.
Details
model = "gbm" is native Bernoulli-deviance gradient boosting
with the settings this function always used for gbm: 100 trees,
interaction.depth = 3 (three best-first splits per tree),
shrinkage 0.1 and at least 10 observations per node, leaves set by a
Newton step on the binomial deviance. It differs from a default
gbm::gbm() call in one respect: no row subsampling (gbm's
bag.fraction = 1), so the scores are deterministic and need no
seed. Factor covariates enter through their treatment-contrast dummy
columns. Cross-validated against gbm (with
bag.fraction = 1) in the tests; gbm is not needed at run
time.
