estimate_gps {CausalGPS}R Documentation

Estimate GPS Values

Description

Estimates GPS value for each observation using parametric or non-parametric approaches.

Usage

estimate_gps(
  Y,
  w,
  c,
  pred_model,
  gps_model = "parametric",
  internal_use = TRUE,
  params = list(),
  nthread = 1,
  ...
)

Arguments

Y

A vector of observed outcome variable.

w

A vector of observed continuous exposure variable.

c

A data frame of observed covariates variable.

pred_model

The selected prediction model.

gps_model

Model type which is used for estimating GPS value, including parametric (default) and non-parametric.

internal_use

If TRUE will return helper vectors as well. Otherwise, will return original data + GPS value.

params

Includes list of params that is used internally. Unrelated parameters will be ignored.

nthread

An integer value that represents then number threads to use by internal packages.

...

Additional arguments passed to the model.

Value

The function returns a list of 6 objects according to the following order:

Examples

m_d <- generate_syn_data(sample_size = 100)
data_with_gps <- estimate_gps(m_d$Y,
                              m_d$treat,
                              m_d[c("cf1","cf2","cf3","cf4","cf5","cf6")],
                              pred_model = "sl",
                              gps_model = "parametric",
                              internal_use = FALSE,
                              params = list(xgb_max_depth = c(3,4,5),
                                       xgb_nrounds=c(10,20,30,40,50,60)),
                              nthread = 1,
                              sl_lib = c("m_xgboost")
                             )


[Package CausalGPS version 0.2.7 Index]