Learn R Programming

mixcure (version 2.0)

plot.predict.mixcure: Plot method for the prediction of mixture cure models

Description

Plot the predicted survival function curves from mixture cure models

Usage

# S3 method for predict.mixcure
plot(
  x,
  type = "l",
  add = FALSE,
  which = 1:nrow(x$cure),
  curemark = FALSE,
  conditional = FALSE,
  xlab,
  ylab,
  ylim = c(0, 1),
  lty = seq(along = which),
  ...
)

Arguments

x

an object from predict.mixcure

type

line type. The default is type = "l"

add

if add = FALSE (default), a plot is shown in a new graphics window. Otherwise, an existing window is used.

which

a vector of row numbers for which the survival probabilities will be drawn. The default is to draw the survival probabilities for all rows.

curemark

if curemark = TRUE, a line will be drawn at a height that is equal to the cure rate

conditional

if conditional = FALSE (default), the unconditional survival probabilities will be drawn. Otherwise, the survival probabilities of uncured subjects will be drawn.

xlab

the label for x axis

ylab

the label for y axis

ylim

the range for y axis

lty

the line types for survival curves from different groups

other standard graphics parameters can be set here.

Value

a graphics window will be opened and drawn.

Details

This function plots survival probabilities for each row in newdata. The survival probabilities can be conditional probabilities for uncured subjects or unconditional survival probabilities, the latter will level off at estimated cure rates.

See Also

mixcure predict.mixcure

Examples

Run this code
# NOT RUN {
data(leukaemia)
plot(predict(mixcure(Surv(time, cens) ~ transplant, ~ transplant,
data = leukaemia), newdata = leukaemia[1, ], times = 0:2000))

# }

Run the code above in your browser using DataLab