[R] interval-censored data in survreg()

Thomas Lumley tlumley at u.washington.edu
Thu Feb 27 22:31:03 CET 2003

On Thu, 27 Feb 2003, Jerome Asselin wrote:

> I am trying to fit a lognormal distribution on interval-censored
> data. Some of my intervals have a lower bound of zero.
> Unfortunately, it seems like survreg() cannot deal with lower
> bounds of zero, despite the fact that plnorm(0)==0 and
> pnorm(-Inf)==0 are well defined. Below is a short example to
> reproduce the problem.
> Does anyone know why survreg() must behave that way?
> Is there an alternate solution to this problem?

The code takes the log transformation of all the numbers and then checks
that they are finite, which they aren't.  Removing the checks gives NA
answers, so I would guess that some part of the C code uses an computation
that needs to be written differently to be valid for infinite arguments.

You could maximise the loglikelihood directly with nlm or similar, or you
could add a small epsilon to your data. If there really isn't a
singularity at zero then this will work perfectly well.


More information about the R-help mailing list