Ported from multinma::geom_km() (Phillippo et al. 2020). Returns a list of
ggplot2 layers, so it can be added to an existing plot; adding it to
plot_survival() overlays the observed data on the fitted survival curves.
Arguments
- object
A
cmlnmr()fit withfamily = "survival".- ...
Passed to
survival::survfit().- curve_args, cens_args
Optional lists of arguments customizing the curves (
ggplot2::geom_step()) and the censoring marks (ggplot2::geom_point()).
Details
Only status 1 counts as an event; statuses 0, 2, and 3 (right, left,
and interval censoring) are treated as censored for the empirical curve.
Examples
if (FALSE) {
plot_survival(fit) + geom_km(fit)
}