| calibrate_survival | R Documentation |
Finds the formula and shape whose simstudy Weibull curve,
S(t) = exp(-exp(formula) * t^(1 / shape)) with scale fixed at 1, passes
as closely as possible through the supplied points. The fit is a
least-squares fit of log(time) on log(-log(survival)), run with
L-BFGS-B, and the returned formula and shape can be handed straight to
define_survival() or survival_curve().
calibrate_survival(time, survival)
time |
Increasing positive times. A finite numeric vector of at least
two strictly increasing values, the same length as |
survival |
Survival probabilities at those times. A finite numeric
vector strictly inside |
A one-row base data.frame with the calibrated numeric formula and
shape, the optim() convergence code (always 0, since a
non-converged fit raises an error), and rmse, the root mean squared
residual on the log-time scale.
calibrate_survival(time = c(50, 100, 150), survival = c(0.9, 0.7, 0.4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.