On Wed, Nov 16, 2011 at 3:06 PM, Milan Bouchet-Valat <nalimi...@club.fr>wrote:

> 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?


Yes, remove one (or more) covariate(s). The design matrix is almost
certainly singular.

Does something need to be improved in aftreg.fit?
>

Yes, error messages. I'll look at it.

Göran

>
> 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)
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Göran Broström

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to