Kaplan-Meier curves

Share:

Description

plot Kaplan-Meier survival curves

Usage

1
2
3
4
5
6
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)

Arguments

time
  • a numeric vector for time

  • a character string with the name of time variable in the data.frame

event
  • a numeric vector for event (censoring)

  • a character string with the name of event variable in the data.frame

group
  • a factor to group the curves

  • a character string with the name of the group variable in the data.frame

data

data.frame if used character string for (time,event,group)

vnames

a vector of character strings with the names of groups in the legend

main

an overall title for the plot

xlab

a title for the x axis

ylab

a title for the y axis

xlim

the x limits (x1, x2) of the plot

ylim

the y limits (y1, y2) of the plot

xticks

the number of ticks on the x axis or a vector of exact ticks

legendon

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.

lwd

the line width

lty

the line type

col

a vector of colors for each curve

tcol

color of the text in whole plot

bgcol

the background color for plot dekoration

pdigs

a number indicate how to round p-values.: see ?format.pval.ade

CI

logical asking whether to plot confidence intervals

ycut

logical asking whether to cut the y axis, if the space is not used

zenspoints

logical asking whether to draw censored datapoint

test

logical asking whether to test for the difference between curves

wall

a number between 0 and 6 for selection the dekoration style of the plot.

Details

The p-value comes from a logrank test

Examples

1
2
3
4
times<-  sort(abs(rnorm(1000)))
events<- round(runif(1000))
groups<- round(runif(1000, 0, 3))
KM.plot.ade(times, events,  groups, wall=2)