This is a test version of Biostars. For the public version, visit https://www.biostars.org.
survival analysis using R

I want to add censored data info on my plot how to I do that

try_surv <- survfit(Surv(Survival,Vital_status)~ 1, conf.type="none") plot(try_surv, xlab="Survival", ylab="Survival Probability") I got a plot like this :

survival plot

I want the vertical lines on the curve to mark the censored data.

r survival analysis

1 answer

Try this

plot(try_surv,mark.time=TRUE, xlab="Survival", ylab="Survival Probability")

thank you @sysbiocoder it worked.

Is there a way to put the number of samples included in each curve on the plot?

Log in to answer this question.