[R] "Non-finite finite-difference value" error in eha's aftreg
nalimilan at club.fr
Thu Dec 1 12:08:01 CET 2011
Le mercredi 30 novembre 2011 à 18:41 +0100, Göran Broström a écrit :
> On Wed, Nov 16, 2011 at 3:06 PM, Milan Bouchet-Valat
> <nalimilan at club.fr> wrote:
> Hi list!
> I'm getting an error message when trying to fit an accelerated
> time parametric model using the aftreg() function from package
> > Error in optim(beta, Fmin, method = "BFGS", control =
> list(trace =
> > as.integer(printlevel)), :
> > non-finite finite-difference value 
> This only happens when adding four specific covariates at the
> same time
> in the model (see below). I understand that kind of problem
> can come
> from a too high correlations between my covariates, but is
> anything I can do to avoid it?
> Yes, remove one (or more) covariate(s). The design matrix is almost
> certainly singular.
Ah, thanks, that's what I feared. ;-)
What do you mean, though, by "almost"? Is there a way to measure that?
> Does something need to be improved in aftreg.fit?
> Yes, error messages. I'll look at it.
Cool. It's always good to get a clear message saying that you're asking
for something impossible, so that you don't try to fix it (like I did).
> My data set is constituted of 34,505 observations (years) of
> individuals, which seems reasonable to me to fit a complex
> that (covariates are all factors with less than 10 levels).
> I can send
> it by private mail if somebody wants to help debugging this.
> The details of the model and errors follow, but feel free to
> more testing. I'm using R 2.13.1 (x86_64-redhat-linux-gnu),
> and survival 2.36-9.
> Thanks for your help!
> > m <-aftreg(Surv(start, end, event) ~ homo1 + sexego +
> + + t.since.school.q,
> + data=ms, dist="loglogistic", id=ident)
> Error in optim(beta, Fmin, method = "BFGS", control =
> as.integer(printlevel)), :
> non-finite finite-difference value 
> Calls: aftreg -> aftreg.fit -> aftp0 -> optim
> > traceback()
> 4: optim(beta, Fmin, method = "BFGS", control = list(trace =
> hessian = TRUE)
> 3: aftp0(printlevel, ns, nn, id, strata, Y, X, offset, dis,
> 2: aftreg.fit(X, Y, dist, strats, offset, init, shape, id,
> 1: aftreg(Surv(start, end, event) ~ homo1 + sexego + dipref1 +
> t.since.school.q, data = ms, dist = "loglogistic", id =
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible
> Göran Broström
More information about the R-help