# \donttest{
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')
)
selection_predictors <- c("x2","x6")
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 = FALSE
)
target.obj <- TEstimator_wrapper(
Estimator = "Crude",
data = target.data,
vars_name = vars_name,
name = "RCT",
data.public = FALSE,
isTrial = TRUE
)
strata <- c("x1","x4")
source.rep.obj <- SEstimator_wrapper(Estimator = "Exact",
target.obj = target.obj,
source.obj = source.obj,
selection_predictors =
selection_predictors)
source.rep.obj$EstimateRep(stratification = strata, stratification_joint = TRUE)
fusion <- Fusion$new(target.obj,
source.obj,
source.rep.obj)
fusion$plot()
fusion$evaluate()
# }
Run the code above in your browser using DataLab