weight_model_data_indices | R Documentation |
weight_model_data_indices(
object,
type = c("switch", "censor"),
model,
set_col = NULL
)
object |
A trial_sequence object |
type |
Select a censoring or switching model |
model |
The model name |
set_col |
A character string to specifying a new column to contain indicators for observations used in fitting this model. |
If set_col
is not specified a logical data.table
column is returned. Otherwise
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.