Estimate propensity scores via logistic regression
Source:R/causal.R
morie_estimate_propensity_scores.RdThin wrapper over WeightIt::weightit(method = "glm",
estimand = "ATE") when WeightIt is installed; falls back
to stats::glm(family = binomial()) otherwise.
Usage
morie_estimate_propensity_scores(
data,
treatment,
covariates,
trim = c(0.01, 0.99)
)Examples
df <- data.frame(t = c(0, 1, 0, 1, 0, 1), x = rnorm(6))
ps <- morie_estimate_propensity_scores(df, "t", "x")