Skip to contents

Estimates a model for generalized propensity score (GPS) using parametric approach.

Usage

estimate_gps(cov_mt, w_all, sl_lib, dnorm_log)

Arguments

cov_mt

A covariate matrix containing all covariates. Each row is a data sample and each column is a covariate.

w_all

A vector of observed exposure levels.

sl_lib

A vector of SuperLearner's package libraries.

dnorm_log

Logical, if TRUE, probabilities p are given as log(p).

Value

A data.frame that includes:

  • a vector of estimated GPS at the observed exposure levels;

  • a vector of estimated conditional means of exposure levels when the covariates are fixed at the observed values;

  • estimated standard deviation of exposure levels

  • a vector of observed exposure levels.

Examples

# \donttest{
data <- generate_synthetic_data(sample_size = 200)
gps_m <- estimate_gps(cov_mt = data[,-(1:2)],
                      w_all = data$treat,
                      sl_lib = c("SL.xgboost"),
                      dnorm_log = FALSE)
# }