[R] Kaplan-Meier plot

Medic m@|||P@dpo@t @end|ng |rom gm@||@com
Thu Jan 17 20:39:00 CET 2019


According to the guidelines (if I'm not mistaken), the code below is
sufficient (without any specification) to give Kaplan-Meier curves with
censored data markings on Kaplan-Meier curves. But in my case censored data
don't appears on the curves?!

library(survival)
mydata<-read.csv (file="C:/mydata/mydata.csv", header=TRUE, sep=";" )
# Sic! The separator in my csv file is ";"

dput (mydata, "dputmydata.r")
#attached

Y <- Surv (mydata$time, mydata$status == 2)
# 2 -- encodes event

km <- survfit (Y~mydata$stage)

plot (km)


More information about the R-help mailing list