Skip to main content

Plot a Kaplan-Meier VPC

Description

Draws each stratum’s observed Kaplan-Meier curve over the replicate band from [ferx_vpc_tte](ferx_vpc_tte.qmd). With the vpc package installed the plot is vpc::plot_vpc()’s time-to-event plot (a ggplot); otherwise it is drawn with base graphics, one panel per stratum. Either way the band is a step ribbon: the band at grid time t[k] holds until t[k + 1].

Usage

# S3 method for ferx_vpc_tte
plot(x, y = NULL, engine = c("auto", "vpc", "base"), ...)

Arguments

  • x: A ferx_vpc_tte object.
  • y: Unused.
  • engine: "auto" (vpc when installed, else base graphics), "vpc" or "base".
  • ...: Passed to vpc::plot_vpc() (for example xlab, title, smooth) or to graphics::plot().

Value

With vpc, the ggplot object; otherwise x, invisibly.