predict_and_plot {easysurv} | R Documentation |
Predict and Plot Fitted Models
Description
This function generates survival and hazard predictions and plots for each
model in a fit_models
object. Optionally, interactive plotly
outputs can be added for each plot.
Usage
predict_and_plot(
fit_models,
eval_time = NULL,
km_include = TRUE,
subtitle_include = TRUE,
add_plotly = FALSE
)
Arguments
fit_models |
An object returned from fit_models. |
eval_time |
(Optional) A vector of evaluation time points for generating
predictions. Default is |
km_include |
A logical indicating whether to include Kaplan-Meier
estimates in the plot outputs. Default is |
subtitle_include |
A logical indicating whether to include the subtitle.
Default is |
add_plotly |
A logical indicating whether to add interactive plotly
outputs for each plot. Default is |
Value
A list of predictions and plots for each model in the
fit_models
object.
Examples
models <- fit_models(
data = easysurv::easy_bc,
time = "recyrs",
event = "censrec",
predict_by = "group"
)
predict_and_plot(models)