View source: R/predict_survival_curves.R
| predict_survival_curves | R Documentation |
Predicts survival probability at every combination of temps × durations
under a fitted 4PL, then returns the posterior median and 95% credible
interval at each grid point. Random effects are marginalised out.
predict_survival_curves(
workflow,
temps = NULL,
durations = NULL,
ndraws = NULL,
probs = c(0.025, 0.5, 0.975),
by = NULL
)
workflow |
A fitted |
temps |
Numeric vector of temperatures (°C). Default: unique assay temperatures in the training data. |
durations |
Numeric vector of durations. Default: 250 log-spaced values spanning 0.2× to 5× the observed range. |
ndraws |
Posterior draws to use; |
probs |
Numeric length-3 quantile probabilities (lower, median,
upper). Default |
by |
Optional moderator column(s) for per-group curves. |
Use this for curves (a handful of temperatures, dense in duration). For a
2-D survival heatmap call derive_tdt_landscape() instead.
A list with elements summary (tibble of temp, duration,
survival_median, survival_lower, survival_upper; plus the
moderator column(s) for a grouped fit), draws_matrix (the raw
posterior matrix [ndraws x grid points] of survival
probabilities), and grid (the prediction grid tibble from
new_tdt_grid()). Use get_surv_draws() for the long-tibble form
of the draws.
## Not run:
wf <- fit_4pl(d, ...)
pred <- predict_survival_curves(wf, temps = c(30, 32, 34))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.