powered by
Kaplan-Meier estimates. If only one curve, confidence limits according to Greenwood's formula are drawn.
# S3 method for Surv plot(x, strata = NULL, fn = c("cum", "surv", "log", "loglog"), limits = TRUE, conf = 0.95, main = NULL, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, lty = NULL, col = NULL, lty.con = NULL, col.con = NULL, x.axis = TRUE, printLegend = TRUE, ...)
A Surv object.
Surv
Defines a partition of the data. One survivor function for each level of strata is drawn.
strata
Which type of plot?
If TRUE, and if the number of curves is one, confidence limits are drawn.
The confidence level for the confidence limits.
A heading for the plot.
Label on the x axis.
Label on the y-axis.
Horizontal plot limits. If NULL, calculated by the function.
Vertical plot limits. If NULL, set to c(0, 1)
c(0, 1)
Line type of curves.
Color of curves.
Line type of confidence bands.
Color of confidence bands.
Should abline(h=0) be drawn?
abline(h=0)
Logical, defaults to TRUE. If FALSE, no legend is printed, but can be added after plotting. To be used if the default place for the legend fits badly.
TRUE
FALSE
Anything that plot likes...
plot
No value is returned.
Left truncation is allowed. Note, though, that this fact may result in strange estimated curves due to lack of data in certain (low) ages.
# NOT RUN { time0 <- numeric(50) group <- c(rep(0, 25), rep(1, 25)) time1 <- rexp( 50, exp(group) ) event <- rep(1, 50) plot(Surv(time0, time1, event), strata = group) # }
Run the code above in your browser using DataLab