0

I am working to create a nice looking plot of the survfit return in R. The default time unit on the x-axis is a long integer, which I am assuming is seconds or milliseconds. This persists no matter what the unit of time is that is originally passed to the Surv(time, event) function. I have tried passing the start and stop times as POSIXcs dates as well as in milliseconds. Does anyone know how to indicate to either survfit or plot.survfit that I would like the time result to be in either Days, Hours format or HH:MM format? Thanks for your help.

survival <- survfit(Surv(time=starteventtime,event=endevent,time2=stoptime)~1)
plot(survival)

the current plot rendered

lolynns
  • 339
  • 1
  • 8
  • 1
    Why don't you divide the interval values by whatever is the appropriate divisor so that the intervals will be calculated in the desired units? Doubtful that you can get output in HH:MM format, though. The survfit function doesn't really have a notion of units. – IRTFM Dec 05 '16 at 23:18
  • Thank you for your response. That worked. I thought I had already tried that, but it's possible in my noodling, that particular test case scenario has some other error in it that made me think it didn't work, when it did. If anyone else happens upon this question, the [documentation](https://stat.ethz.ch/R-manual/R-devel/library/survival/html/survfit.object.html) for the survfit object proved to be very helpful. – lolynns Dec 08 '16 at 18:50

0 Answers0