Kaplan-Meier curve
This function plots the Kaplan-Meier curve without returning outputs
km(time, censor, plotcens)
time
: a vector of event or censoring timecensor
: a vector indicating censoring: 0 = censored; 1 = uncensoredplotcens
: 0: don't add censored data symbol to the output curve 1: add censored data symbol to the output curveKaplan-Meier curve only
t1 <- c(2,3,4,5.5,7,10,12,15) c1 <- c(0,0,1,0,0,1,0,0) km(t1,c1,0)
Useful links