| define_survival | R Documentation |
Records one Weibull hazard segment for one event time. The simstudy
parameterization is used throughout: an event time drawn from this segment
has survival function S(t) = exp(-exp(formula) * t^(1 / shape) / scale), so
shape is the reciprocal of the textbook Weibull shape, and
exp(formula) multiplies the whole cumulative hazard. A coefficient inside
formula is therefore a log hazard ratio, while formula itself equals the
log hazard only when shape and scale are both 1.
define_survival(event, formula = 0, scale = 1, shape = 1, transition = 0)
event |
Name of the event-time variable. A single non-empty string. |
formula |
Linear predictor on the log scale, given as a number, a
string, or an unquoted expression over the covariate columns (for example
|
scale |
Positive Weibull scale, as a number, a string, or an expression
over the covariates. Defaults to |
shape |
Positive Weibull shape in the simstudy parameterization (the
exponent applied to the transformed time, so the hazard is constant when
|
transition |
Time at which this hazard segment begins. A single finite
non-negative number, defaulting to |
A one-row simulab_survival_spec base data.frame with columns
event, formula, scale and shape (all character, the stored
definition text) and the numeric column transition.
define_survival("time", formula = -8, shape = 0.3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.