The time-to-event model for outcome
is specified with this method. Any adjustment terms can be specified.
For ITT and PP estimands the treatment_var
is not specified as it is automatically defined as
assigned_treatment
. Importantly, the modelling of "time" is specified in this model with arguments for
trial start time and follow up time within the trial.
set_outcome_model(object, ...)# S4 method for trial_sequence
set_outcome_model(
object,
treatment_var = ~0,
adjustment_terms = ~1,
followup_time_terms = ~followup_time + I(followup_time^2),
trial_period_terms = ~trial_period + I(trial_period^2),
model_fitter = stats_glm_logit(save_path = NA)
)
# S4 method for trial_sequence_ITT
set_outcome_model(
object,
adjustment_terms = ~1,
followup_time_terms = ~followup_time + I(followup_time^2),
trial_period_terms = ~trial_period + I(trial_period^2),
model_fitter = stats_glm_logit(save_path = NA)
)
# S4 method for trial_sequence_PP
set_outcome_model(
object,
adjustment_terms = ~1,
followup_time_terms = ~followup_time + I(followup_time^2),
trial_period_terms = ~trial_period + I(trial_period^2),
model_fitter = stats_glm_logit(save_path = NA)
)
# S4 method for trial_sequence_AT
set_outcome_model(
object,
treatment_var = "dose",
adjustment_terms = ~1,
followup_time_terms = ~followup_time + I(followup_time^2),
trial_period_terms = ~trial_period + I(trial_period^2),
model_fitter = stats_glm_logit(save_path = NA)
)
A modified object
with the outcome_model
slot set
A trial_sequence object
Parameters used by methods
The treatment term, only used for "as treated" estimands. PP and ITT are fixed to use "assigned_treatment".
Formula terms for any covariates to adjust the outcome model.
Formula terms for followup_time
, the time period relative to the start of the trial.
Formula terms for trial_period
, the time period of the start of the trial.
A te_model_fitter
object, e.g. from stats_glm_logit()
.
trial_sequence("ITT") |>
set_data(data_censored) |>
set_outcome_model(
adjustment_terms = ~age_s,
followup_time_terms = ~ stats::poly(followup_time, degree = 2)
)
Run the code above in your browser using DataLab