plot_predicted_survival() draws one step curve per row of newdata, from any model whose
predict() method gives per-subject curves as a data frame with the columns subject, time,
and estimate, such as cox_ph(), survival_tree(), random_survival_forest(),
royston_parmar(), or aft(). It shows how the predicted survival differs between subjects,
where plot_survival() shows the curves of groups.
Usage
plot_predicted_survival(
model,
newdata,
type = c("survival", "cumhaz"),
times = NULL,
labels = NULL,
xlab = "Time",
ylab = NULL
)Arguments
- model
A fitted model with per-subject survival predictions.
- newdata
A data frame of the subjects to predict for.
- type
"survival"(the default) or"cumhaz", passed on topredict().- times
Optional times at which to predict, passed on to
predict(). Models that predict at their own event times by default don't need them.- labels
Optional labels for the subjects, one per row of
newdata. The default is the row numbers.- xlab, ylab
The axis labels. The default
ylabdepends ontype.

