Skip to contents

Ported from multinma's 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.

Usage

geom_km(object, ..., curve_args = list(), cens_args = list())

Arguments

object

A cmlnmr() fit with family = "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()).

Value

A list of ggplot2 layers.

Details

Only right-censored survival data are supported: status 1 is an event and status 0 is right censoring. Delayed entry is honored when configured on the fitted model. Curves reconstructed from aggregate event/censoring rows are labeled as reconstructed AgD and must not be read as observed IPD.

See also

Examples

if (FALSE) {
plot_survival(fit) + geom_km(fit)
}