set_censor_weight_model {TrialEmulation} | R Documentation |
Set censoring weight model
Description
Usage
set_censor_weight_model(
object,
censor_event,
numerator,
denominator,
pool_models = NULL,
model_fitter
)
## S4 method for signature 'trial_sequence'
set_censor_weight_model(
object,
censor_event,
numerator,
denominator,
pool_models = c("none", "both", "numerator"),
model_fitter = stats_glm_logit()
)
## S4 method for signature 'trial_sequence_PP'
set_censor_weight_model(
object,
censor_event,
numerator,
denominator,
pool_models = "none",
model_fitter = stats_glm_logit()
)
## S4 method for signature 'trial_sequence_ITT'
set_censor_weight_model(
object,
censor_event,
numerator,
denominator,
pool_models = "numerator",
model_fitter = stats_glm_logit()
)
## S4 method for signature 'trial_sequence_AT'
set_censor_weight_model(
object,
censor_event,
numerator,
denominator,
pool_models = "none",
model_fitter = stats_glm_logit()
)
Arguments
object |
trial_sequence. |
censor_event |
string. Name of column containing censoring indicator. |
numerator |
A RHS formula to specify the logistic models for estimating the numerator terms of the inverse probability of censoring weights. |
denominator |
A RHS formula to specify the logistic models for estimating the denominator terms of the inverse probability of censoring weights. |
pool_models |
Fit pooled or separate censoring models for those treated and those untreated at the immediately previous visit. Pooling can be specified for the models for the numerator and denominator terms of the inverse probability of censoring weights. One of "none", "numerator", or "both" (default is "none" except when estimand = "ITT" then default is "numerator"). |
model_fitter |
An object of class |
Value
object
is returned with @censor_weights
set
Examples
trial_sequence("ITT") |>
set_data(data = data_censored) |>
set_censor_weight_model(
censor_event = "censored",
numerator = ~ age_s + x1 + x3,
denominator = ~ x3 + x4,
pool_models = "both",
model_fitter = stats_glm_logit(save_path = tempdir())
)