trial_pp <- trial_sequence("PP") |>
set_data(data_censored) |>
set_switch_weight_model(
numerator = ~age,
denominator = ~ age + x1 + x3,
model_fitter = stats_glm_logit(tempdir())
) |>
calculate_weights()
ipw_data(trial_pp)
show_weight_models(trial_pp)
# get logical column for own processing
i <- weight_model_data_indices(trial_pp, "switch", "d0")
# set column in data
weight_model_data_indices(trial_pp, "switch", "d0", set_col = "sw_d0")
weight_model_data_indices(trial_pp, "switch", "d1", set_col = "sw_d1")
ipw_data(trial_pp)
Run the code above in your browser using DataLab