[R] showing ticks for censored data in survfit() in the rms package

Andrew Yee yee at post.harvard.edu
Wed Sep 5 23:05:38 CEST 2012


The answer to this may be obvious, but I was wondering in the rms
package and the survfit(), how you can plot the censored time points
as ticks.

Take for example,

library(survival)
library(rms)

foo <- data.frame(Time=c(1,2,3,4,5,6,10), Status=c(1,1,0,0,1,1,1))
answer <- survfit(Surv(foo$Time, foo$Status==1) ~1)

# this shows the censored time points as ticks at Time = 3 and 4
plot(answer)

# how do you achieve something similar with survplot()
survplot(answer)

Thanks,
Andrew



More information about the R-help mailing list