Skip to contents

Thin 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)
)

Arguments

data

A data frame.

treatment

Name of the binary treatment column.

covariates

Character vector of covariate names.

trim

Quantile pair used to winsorize extreme scores (default 0.01, 0.99).

Value

Numeric vector of propensity scores (same length as nrow(data)).

Examples

df <- data.frame(t = c(0, 1, 0, 1, 0, 1), x = rnorm(6))
ps <- morie_estimate_propensity_scores(df, "t", "x")