[R] "Non-finite finite-difference value" error in eha's aftreg

Milan Bouchet-Valat nalimilan at club.fr
Wed Nov 16 15:06:00 CET 2011


Hi list!


I'm getting an error message when trying to fit an accelerated failure
time parametric model using the aftreg() function from package eha:
> Error in optim(beta, Fmin, method = "BFGS", control = list(trace =
>   as.integer(printlevel)),  : 
> non-finite finite-difference value [2]

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 there
anything I can do to avoid it? Does something need to be improved in
aftreg.fit?

My data set is constituted of 34,505 observations (years) of 2,717
individuals, which seems reasonable to me to fit a complex model like
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 ask for
more testing. I'm using R 2.13.1 (x86_64-redhat-linux-gnu), eha 2.0-5
and survival 2.36-9.


Thanks for your help!


> m <-aftreg(Surv(start, end, event) ~ homo1 + sexego + dipref1
+                                    + t.since.school.q,
+            data=ms, dist="loglogistic", id=ident)
Error in optim(beta, Fmin, method = "BFGS", control = list(trace =
as.integer(printlevel)),  : 
  non-finite finite-difference value [2]
Calls: aftreg -> aftreg.fit -> aftp0 -> optim

> traceback()
4: optim(beta, Fmin, method = "BFGS", control = list(trace =
as.integer(printlevel)), 
       hessian = TRUE)
3: aftp0(printlevel, ns, nn, id, strata, Y, X, offset, dis, means)
2: aftreg.fit(X, Y, dist, strats, offset, init, shape, id, control, 
       center)
1: aftreg(Surv(start, end, event) ~ homo1 + sexego + dipref1 + 
       t.since.school.q, data = ms, dist = "loglogistic", id = ident)



More information about the R-help mailing list