plot.changepoint: Plot functions for change-point models

plot.changepointR Documentation

Plot functions for change-point models

Description

Plot functions for change-point models

Usage

## S3 method for class 'changepoint'
plot(
  object,
  type = "survival",
  chng.num = "all",
  add.km = T,
  max_predict = 10,
  add.post = T,
  alpha.pos = NULL,
  t_pred = NULL,
  final_chng_only = F,
  col_km = "black",
  km_risk = NULL,
  ...
)

Arguments

object

an object of class "changepoint".

type

the type of plot to be drawn, default is the survival function. Also can plot the hazard function with "hazard".

chng.num

value indicating the changepoint model to plotted, default is "all", in which all posterior simulations will be used.

add.km

indicator to add Kaplan Meier curve. Only applicable to survival function. Default is true.

max_predict

maximum time to be plotted. Default is 10, however, depending on the timescale this should be changed.

add.post

indicator whether to plot the posterior simulations (a random sample of 500) for the survival function. Default is true.

Value

a ggplot object

Examples

## Not run: 
plot(Collapsing_Model, add.post = F)
plot(Collapsing_Model, type = "hazard")
## End(Not run)

Philip-Cooney/PiecewiseChangepoint documentation built on Sept. 10, 2023, 9:49 p.m.