SEstimator_wrapper {RCTrep}R Documentation

Estimating the weighted conditional average treatment effects in source.obj based on input objects source.obj and target.obj of class TEstimator.

Description

Estimating the weighted conditional average treatment effects in source.obj based on input objects source.obj and target.obj of class TEstimator.

Usage

SEstimator_wrapper(
  Estimator,
  target.obj,
  source.obj,
  selection_predictors,
  method = "glm",
  sampling_formula = NULL,
  ...
)

Arguments

Estimator

a character specifying an estimator for weight. The allowed estimators are "Exact", "ISW", and "Subclass".

target.obj, source.obj

an instantiated object of class TEstimator.

selection_predictors

a character vector specifying the names of variables in data of source.obj and target.obj. Weights are estimated based on the variables.

method

an optional character specifying a model for estimating sampling probability when Estimator='ISW' or Estimator='Subclass'.

sampling_formula

an object of class formula specifying a model specification for sampling probability. Default value is NULL.

...

an optional argument specifying training and tuning for a model of sampling probability. See https://topepo.github.io/caret/model-training-and-tuning.html for details.

Value

An object of class SEstimator

Examples


source.data <- RCTrep::source.data
target.data <- RCTrep::target.data

vars_name <- list(outcome_predictors = c("x1","x2","x3","x4","x5","x6"),
                  treatment_name = c('z'),
                  outcome_name = c('y'))

target.obj <- TEstimator_wrapper(
  Estimator = "Crude",
  data = target.data,
  vars_name = vars_name,
  name = "RCT",
  data.public = FALSE,
  isTrial = TRUE)

source.obj <- TEstimator_wrapper(
  Estimator = "G_computation",
  data = source.data,
  vars_name = vars_name,
  outcome_method = "glm",
  outcome_form=y ~ x1 + x2 + x3 + z + z:x1 + z:x2 +z:x3+ z:x6,
  name = "RWD",
  data.public = TRUE)

source.rep.obj <- SEstimator_wrapper(Estimator="Exact",
                                     target.obj=target.obj,
                                     source.obj=source.obj,
                                     selection_predictors=c("x2","x6"))
source.rep.obj$EstimateRep(stratification = c("x1","x3","x4","x5"),
                           stratification_joint = TRUE)



[Package RCTrep version 1.2.0 Index]