[R] Interval censored Data in survreg() with zero values!
therneau at mayo.edu
Wed Dec 24 17:50:57 CET 2008
The problem is that you are not coding your data the way that I would; program
authors do not always anticipate what others will do! The Weibull distribution
has support on (0, infinity). Using Surv(t1, t2, type='interval2'), you can
a left censored observation where time of event < t: represented as (NA, t)
a right censored observation where time of event >t: represented as (t, NA)
an interval censored observations t1<=time <= t2 : represented as (t1,t2)
Notice that the NA is just a trick of representation, it does not cause
something to be omitted from the data.
The survreg code assumes that the third form will only be used when t1 and t2
are strictly within the range of the data. (Which is how I would do it, so is
of course the OBVIOUS thing anyone would do :-) For a Weibull with event
between 0 and t the right-censored representation (NA,t) and the interval
censored representation (0,t) are mathematically equivalent, but the program
doesn't like the second form.
This is on my list of enhancements to add. It may even get to the top of the
I have interval censored data, censored between (0, 100). I used the
tobit function in the AER package which in turn backs on survreg.
Actually I'm struggling with the distribution. Data is asymmetrically
distributed, so first choice would be a Weibull distribution.
Unfortunately the Weibull doesn't allow for zero values in time data,
as it requires x > 0. So I tried the exponential distribution that
allows x to be >= 0 and the log-normal that sets x <= 0 to 0. Still I
get the same error:
" Fehler in survreg(formula = Surv(ifelse(A16_1_1 >= 100, 100,
ifelse(A16_1_1 <= :
Invalid survival times for this distribution "
More information about the R-help