estimate_gps {CausalGPS}R Documentation

Estimate generalized propensity score (GPS) values

Description

Estimates GPS value for each observation using normal or kernel approaches.

Usage

estimate_gps(
  .data,
  .formula,
  gps_density = "normal",
  sl_lib = c("SL.xgboost"),
  ...
)

Arguments

.data

A data frame of observed continuous exposure variable and observed covariates variable. Also includes id column for future references.

.formula

A formula specifying the relationship between the exposure variable and the covariates. For example, w ~ I(cf1^2) + cf2.

gps_density

Model type which is used for estimating GPS value, including normal (default) and kernel.

sl_lib

A vector of prediction algorithms to be used by the SuperLearner packageg.

...

Additional arguments passed to the model.

Value

The function returns a S3 object. Including the following:

Examples


m_d <- generate_syn_data(sample_size = 100)
data_with_gps <- estimate_gps(.data = m_d,
                              .formula = w ~ cf1 + cf2 + cf3 + cf4 + cf5 + cf6,
                              gps_density = "normal",
                              sl_lib = c("SL.xgboost")
                             )


[Package CausalGPS version 0.5.0 Index]