plot.tidysurv: Plot a tidysurv object

Description Usage Arguments Value

Description

Plot a tidysurv object

Usage

1
2
3
## S3 method for class 'tidysurv'
plot(x, mapping = NULL, type = "cumulative",
  states = NULL, ...)

Arguments

x

A tidysurv object

mapping

An aesthetic mapping for ggplot, created by one of the aes functions.

type

What type of plot? Cumulative/survival, or rate? If the latter, need to have set time_period in tidysurv.

states

For a competing risks model: which states should be included in the graph?

...

Further arguments to be passed to ggplot

Value

A ggplot object, with lines for each survival curve, and ribbons for confidence bands. Defaults to a separate survival curve (with a distinct color) for each unique combination of predictors that was passed to tidysurv. Also grouped by '.surv_state' for competing risk models, with the linetype indicating which state.


jwdink/tidysurv documentation built on May 20, 2019, 6:24 a.m.