| define_survivals | R Documentation |
Combine survival definitions into a specification
define_survivals(...)
... |
One of three forms. Hazard calls. Specification columns given as named vectors ( Objects created by The forms cannot be mixed in one call. In the column form, |
A simulab_survival_spec base data.frame with one row per hazard
segment and the columns of define_survival(): event, formula,
scale, shape and transition. Rows written by the column form and by
the hazard-call form are ordered by event and then transition.
# One call, named arguments, one row per event.
define_survivals(
event = c("time_relapse", "time_death"),
formula = c(-8, -9),
shape = 0.3
)
# A piecewise hazard is two rows for one event.
define_survivals(
event = c("time", "time"),
formula = c(-8, -6),
shape = 0.3,
transition = c(0, 50)
)
# Definitions built one at a time are still accepted.
define_survivals(
define_survival("time_relapse", formula = -8, shape = 0.3),
define_survival("time_death", formula = -9, shape = 0.3)
)
# Hazard calls. The log rate is an expression over the covariates.
define_survivals(
time_relapse = hazard(log_rate = -8 + 0.5 * treatment, shape = 0.3),
time_death = hazard(log_rate = -9, shape = 0.3)
)
# A repeated event name is a piecewise hazard: the rate rises after day 60.
define_survivals(
time = hazard(log_rate = -8, shape = 0.3),
time = hazard(log_rate = -5, shape = 0.3, from = 60)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.