Learn R Programming

RISCA (version 0.8.2)

plot.survival: Plot Method for 'survival' Objects

Description

A plot of survival curves is produced. In the RISCA package, it concerns the functions ipw.survival and gc.survival.

Usage

# S3 method for survival
plot(x, ..., col=1, lty=1, lwd=1, max.time=NULL, min.y=0, max.y=1)

Arguments

x

An object of class survival, returned by the functions ipw.survival gc.survival.

...

Additional arguments affecting the plot.

col

A numeric vector with the color of the survival curves. The default is 1 for black.

lty

A numeric vector with the type of the survival curves. The default is 1.

lwd

A numeric vector with the type of the survival curves. The default is 1.

max.time

The maximum time of the x-asis. The default is NULL, it corresponds to the maximum follow-up time observed in the database from which the survival.obj was estimated.

min.y

The minimum of the y-axis. The default is 0.

max.y

The maximum of the y-axis. The default is 1.

Examples

Run this code
# NOT RUN {
data(dataDIVAT2)

res.km <- ipw.survival(times=dataDIVAT2$times, failures=dataDIVAT2$failures,
  variable=dataDIVAT2$ecd, weights=NULL)

plot(res.km, ylab="Graft and patient survival",
 xlab="Time post-transplantation (years)", col=c(1,2))
# }

Run the code above in your browser using DataLab