plot_km | R Documentation |
Kaplan-Meier plot with number of subjects at risk below
plot_km(
formula,
data,
test = TRUE,
xy.pvalue = NULL,
conf.int = FALSE,
times.print = NULL,
nrisk.labels = NULL,
legend = NULL,
xlab = NULL,
ylab = NULL,
ylim = c(0, 1.02),
left = 4.5,
bottom = 5,
cex.mtext = par("cex"),
lwd = 2,
lty = 1,
col = NULL,
...
)
formula |
same formula than in |
data |
data frame with |
test |
boolean, |
xy.pvalue |
numeric vector of length 2, coordinates where to display the p-value of the log-rank test |
conf.int |
boolean, |
times.print |
numeric vector, times at which to display the numbers of subjects at risk |
nrisk.labels |
character vector to modify the levels of |
legend |
character string ( |
xlab |
character string, label of the time axis |
ylab |
character string, label of the y axis |
ylim |
numeric vector of length 2, minimum and maximum of the y-axis |
left |
integer, size of left margin |
bottom |
integer, number of lines in addition of the table below the graph |
cex.mtext |
numeric, size of the numbers of subjects at risk |
lwd |
width of the Kaplan-Meier curve(s) |
lty |
type of the Kaplan-Meier curve(s) |
col |
color(s) of the Kaplan-Meier curve(s) |
... |
other arguments to be passed in |
None
Hugo Varet
cgd$time=cgd$tstop-cgd$tstart
plot_km(Surv(time,status)~sex,data=cgd,col=c("blue","red"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.