Skip to contents

Estimates the probability of treatment via logistic regression or gradient boosting on a set of covariates.

Usage

morie_matching_estimate_propensity(
  data,
  treatment,
  covariates,
  model = "logistic",
  max_iter = 1000
)

Arguments

data

Data frame.

treatment

Name of the binary treatment column (0/1).

covariates

Character vector of covariate names.

model

One of "logistic" (default) or "gbm". "gbm" requires the gbm package.

max_iter

Maximum iterations for logistic regression.

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.

References

Rosenbaum, P. R., & Rubin, D. B. (1983). The central role of the propensity score in observational studies for causal effects. Biometrika, 70(1), 41–55.

Examples

if (FALSE) { # \dontrun{
df <- data.frame(d = rbinom(200, 1, 0.4),
                 x1 = rnorm(200), x2 = rnorm(200))
ps <- morie_matching_estimate_propensity(df, "d", c("x1", "x2"))
} # }