survplot {icrf}R Documentation

'Plotting individual survival curves'

Description

Plotting individual survival curves.

Usage

survplot(
  x,
  i,
  smooth = TRUE,
  timepoints = NULL,
  title = "Estimated survival curve",
  suppress.inf.time = TRUE,
  ...
)

Arguments

x

an object of class icrf or a survival matrix with rows representing subjects and columns representing times

i

subject index

smooth

which curve of an icrf object to be plotted? smoothed or non-smoothed. Ignored when x is a matrix.

timepoints

A numeric vector. needed when the time attribute is missing.

title

Title of the plot.

suppress.inf.time

Do not draw the curve at timepoints being infinity?

...

'Other graphical parameters to be passed on to' ggplot.

Value

'Invisibly,' the vector of survival probabilities that are plotted.

Author(s)

Hunyong Cho, Nicholas P. Jewell, and Michael R. Kosorok.

References

Cho H., Jewell N. J., and Kosorok M. R. (2020+). "Interval censored recursive forests"

Examples

# rats data example.
# Note that this is a toy example. Use a larger ntree and nfold in practice.
data(rat2)

 set.seed(1)
 rats.icrf <-
   icrf(~ dose.lvl + weight + male + cage.no, data = rat2,
        data.type = "currentstatus", currentstatus.label = c("survtime", "tumor"),
        returnBest = TRUE, ntree=10, nfold=3)
 survplot(rats.icrf, c(1,3,5))




[Package icrf version 2.0.2 Index]