kmplot | R Documentation |
Make a Kaplan-Meier plot of a data set.
kmplot(
x,
...,
relevel = FALSE,
col = NULL,
plot = TRUE,
xlim = NULL,
ylim = NULL,
xaxis.at = NULL,
xlab = NULL,
ylab = NULL,
lr_test = TRUE,
test_details = TRUE,
median = TRUE,
atrisk = TRUE,
mark.time = TRUE,
title = NULL,
legend = TRUE
)
## S3 method for class 'kmdata'
plot(
x,
...,
relevel = FALSE,
col = NULL,
plot = TRUE,
xlim = NULL,
ylim = NULL,
xaxis.at = NULL,
xlab = NULL,
ylab = NULL,
lr_test = TRUE,
test_details = TRUE,
median = TRUE,
atrisk = TRUE,
mark.time = TRUE,
title = NULL,
legend = TRUE
)
x |
a data set of class |
... |
additional arguments passed to |
relevel |
logical; if |
col |
a vector of colors for the survival curves (recycled for at-risk table, medians, and legend) |
plot |
logical; if |
xlim , ylim |
x- and y-axis limits |
xaxis.at |
x-axis positions of ticks and at-risk table |
xlab , ylab |
the x- and y-axis labels |
lr_test |
logical; if |
test_details |
logical; if |
median |
logical; if |
atrisk |
logical; if |
mark.time |
passed to |
title |
optional title for plot; default is |
legend |
logical; if |
kmplot(ATTENTION_2A)
kmplot(
ATTENTION_2A,
relevel = TRUE, median = FALSE,
col = 3:4, xaxis.at = 0:4 * 6
)
## or equivalently with ?survival::plot.survfit
s <- survfit(Surv(time, event) ~ arm, ATTENTION_2A)
plot(s, col = 1:2, mark.time = TRUE)
## kmplot can be used generically given the proper data structure
dat <- data.frame(time = aml$time, event = aml$status, arm = aml$x)
kmplot(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.