s-news
[Top] [All Lists]

Re: Error message with survReg

To: tristan.lorino@lcpc.fr
Subject: Re: Error message with survReg
From: Terry Therneau <therneau@mayo.edu>
Date: Fri, 27 Oct 2006 14:36:36 -0500 (CDT)
Cc: s-news@lists.biostat.wustl.edu
Reply-to: Terry Therneau <therneau@mayo.edu>
Tristan Lorino asked

I get an error message with survReg (S-Plus 7):

> survReg(Surv(cens04[, 2], cens04[, 3], type = "interval2") ~ cov04[, 2], dist 
= "weibull", na.action = na.exclude)
Problem in survReg(Surv(cens04[, 2], cens04[, 3], type = "interval2")
~ cov04[, ..: Invalid survival times for this distribution

  The error message is clear --- there is an invalid survival time for this
distribution.  I would guess that it is one for which time1 < time2 <=0.
The weibull distribution does not allow a censor or death exactly at the
left endpoint of the distribution, ie on or before day 0.


Then you subset the data set to a smaller group, and got a different error
message:

survReg(Surv(time1, time2, type='interval2' ~ x,
         dist = "weibull", na.action =
        na.exclude, subset=(1250:1260))
Problem in .C("S_coxph_wtest",: subroutine S_coxph_wtest: Missing values in 

 The subset you gave have almost identical event times:
        IdS time1  time2
1250 19176    3    6
1251 19177    3    9
1252 19178    3    6
1253 19179    3    6
1254 19180    3    6
1255 19181    3    6
1256 19182    6    6
1257 19183    6    6
1258 19184    6    6
1259 19185    3    6
1260 19186    3    6

 This is a real bug in survreg, but one I may not get to soon.  The nearly
identical times led to a first estimate of the standard error of approx 0,
which in turn led to values like exp(1200) = Inf.  This in turn cascades into
missing values a few lines later.  The problem is in the code that tries to
guess a reasonable starting value for the iterations.
  There are other things on my queue, this error has not come up before in
over 10 years of distribution, and I don't expect to see it again.  But -- the
next time I am updating survreg I will try to work around the zero variance.

        Terry Therneau

<Prev in Thread] Current Thread [Next in Thread>