plot Kaplan-Meier survival curves
KM.plot.ade(time, event, group=NULL, data=NULL, vnames=NULL,
main="Kaplan-Meier Plot", xlab="Follow-Up Time",
ylab="Cumulative Survival", xlim=NULL, ylim=NULL, xticks=NULL,
legendon='bottomleft', lwd=2, lty=1,
col=NULL, tcol=NULL, bgcol=NULL, pdigs=4,
CI=FALSE, ycut=TRUE, zenspoints=FALSE, test=FALSE, wall=0)a numeric vector for time
a character string with the name of time variable in the data.frame
a numeric vector for event (censoring)
a character string with the name of event variable in the data.frame
a factor to group the curves
a character string with the name of the group variable in the data.frame
data.frame if used character string for (time,event,group)
a vector of character strings with the names of groups in the legend
an overall title for the plot
a title for the x axis
a title for the y axis
the x limits (x1, x2) of the plot
the y limits (y1, y2) of the plot
the number of ticks on the x axis or a vector of exact ticks
a single keyword from:
"bottomright"
"bottom"
"bottomleft"
"left"
"topleft"
"top"
"topright"
"right"
"center"
This places the legend on the inside of the plot frame at the given location.
the line width
the line type
a vector of colors for each curve
color of the text in whole plot
the background color for plot dekoration
a number indicate how to round p-values.: see ?format.pval.ade
logical asking whether to plot confidence intervals
logical asking whether to cut the y axis, if the space is not used
logical asking whether to draw censored datapoint
logical asking whether to test for the difference between curves
a number between 0 and 6 for selection the dekoration style of the plot.
The p-value comes from a logrank test
times<- sort(abs(rnorm(1000)))
events<- round(runif(1000))
groups<- round(runif(1000, 0, 3))
KM.plot.ade(times, events, groups, wall=2)
Run the code above in your browser using DataLab