# \donttest{
set.seed(967)
m_d <- generate_syn_data(sample_size = 200)
m_d$id <- seq_along(1:nrow(m_d))
m_xgboost <- function(nthread = 4,
ntrees = 35,
shrinkage = 0.3,
max_depth = 5,
...) {SuperLearner::SL.xgboost(
nthread = nthread,
ntrees = ntrees,
shrinkage=shrinkage,
max_depth=max_depth,
...)}
data_with_gps_1 <- estimate_gps(
.data = m_d,
.formula = w ~ I(cf1^2) + cf2 + I(cf3^2) + cf4 + cf5 + cf6,
sl_lib = c("m_xgboost"),
gps_density = "normal")
cw_object_matching <- compute_counter_weight(gps_obj = data_with_gps_1,
ci_appr = "matching",
bin_seq = NULL,
nthread = 1,
delta_n = 0.1,
dist_measure = "l1",
scale = 0.5)
pseudo_pop <- generate_pseudo_pop(.data = m_d,
cw_obj = cw_object_matching,
covariate_col_names = c("cf1", "cf2",
"cf3", "cf4",
"cf5", "cf6"),
covar_bl_trs = 0.1,
covar_bl_trs_type = "maximal",
covar_bl_method = "absolute")
# }
Run the code above in your browser using DataLab