0

I read that in Stata, there is an issue where observations can end at t0 and therefore be omitted from the analysis inadvertently. The workaround is to add some small e > 0 to each death at t0 to prevent this. See this link for the description of the issue in Stata. https://www.stata.com/support/faqs/statistics/time-and-cox-model/

https://www.statalist.org/forums/forum/general-stata-discussion/general/1609582-cox-regression-observations-end-on-or-before-enter

My question is how does R handle this using the survival package when running a long rank comparison? I cannot find any relevant documentation, but from running some tests it seems that R automatically adds a tiny bit of epsilon >0 to get around this. Can any one confirm or deny this, and if so provide a way to override the default behavior?

I tried running a parallel analysis in R and Stata, and I got different results. Stat gave the message "

 45,024  total observations
          1  event time missing (GTIME>=.)                      PROBABLE ERROR
        341  observations end on or before enter()

"

While R did not give any such message. The end results of the computation of the Chi sq statistic were different and I think it was because of this discrepancy. Can anyone confirm?

jp5602
  • 41
  • 5

1 Answers1

1

I found the solution: R keeps the observations that perish at t = 0, whereas Stata omits them.

Nick Cox
  • 35,529
  • 6
  • 31
  • 47
jp5602
  • 41
  • 5
  • This answer would be improved greatly if there was a citation to where this knowledge was acquired. – IRTFM Jan 24 '23 at 22:18