[R] Survreg(), Surv() and interval-censored data
Terry Therneau
therneau at mayo.edu
Thu Nov 29 15:33:32 CET 2007
The question (slightly rephrased) was
Why does survreg(Surv(T.1, T.2, type='interval2') ~1, data=x) fail, when x is
T.1 T.2 Status
1 0.0000000 0.62873036 1
2 0.0000000 2.07039068 1
3 0.0000000 1.40297214 1
4 0.0000000 0.09112871 1
5 0.0000000 0.75115280 1
6 0.0000000 2.36476839 1
...
----------------
The default model for survreg is a Weibull, for which a survival time of
exactly zero is not a valid value. Your example triggers this error message.
This is a bug in survreg. In the 10+ years the code has been available, no
one has ever specified this particular data: a (0,x] interval for a Weibull.
Congratulations! Fixing this will require some thought, however.
To work around the problem, change 0 to NA, which marks the observation as
left-censored.
Terry Therneau
(author of survreg)
More information about the R-help
mailing list