[R] interval-censored data in survreg()
Jerome Asselin
jerome at hivnet.ubc.ca
Thu Feb 27 22:21:03 CET 2003
After receiving some feedback, I've realised that
this slight modification corrects the problem, although
I still can't think of a reason why it didn't work the first
way I've done it.
newovarian$time59[newovarian$lower59==0] <-
Surv(59,NA,event=2,type="interval")
#NOW THIS WORKS...
newovarian$lower59 <- newovarian$futime-59
newovarian$time59 <- Surv(newovarian$lower59,newovarian$futime,
event=rep(3,nrow(newovarian)),type="interval")
newovarian$time59[newovarian$lower59==0] <-
Surv(59,NA,event=2,type="interval")
survreg(time59~ecog.ps+rx,data=newovarian,dist="lognormal")
Thanks,
Jerome
On Thursday 27 February 2003 12:36, 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?
>
> Sincerely,
> Jerome Asselin
>
> library(survival)
> data(ovarian)
> newovarian <- ovarian
>
> newovarian$lower59 <- newovarian$futime-59
> newovarian$time59 <- Surv(newovarian$lower59,newovarian$futime,
> event=rep(3,nrow(newovarian)),type="interval")
> survreg(time59~ecog.ps+rx,data=newovarian,dist="lognormal")
> #THIS DOES NOT WORK BECAUSE ONE OF THE LOWER BOUNDS IS ZERO
> #Error in survreg(time59 ~ ecog.ps + rx, data = newovarian,
> # dist = "lognormal") :
> # Invalid survival times for this distribution
More information about the R-help
mailing list