Re: [R] problem with coxph

From: Charles C. Berry <>
Date: Fri, 14 Dec 2007 08:59:27 -0800

On Fri, 14 Dec 2007, wrote:

> Hi everyone,
> I encountered a problem using the coxph function for the conditional
> logistic regression. I am trying to do some simulations and I really don’t
> understand a mistake which happened maybe only 1 time among more than
> 1,000 simulations.
> What appeared on the screen is the following:
> Error in fitter(X,Y,strats,offset,init,control,weights=weights,:
> NA/NaN/Inf in a foreign function (arg 6)
> Warning message:
> Ran out of iterations and did not converge in:
> fiiter(X,Y,strats,offset,init,control,weights=weights,
> I don’t know if the warning message could have caused the error or vice
> versa.
> Does anyone have just an idea of what kind of error it can be? I don’t put

I suspect that the data set in that run has 'issues'. These might include having a near dependency among the regressors - at least when weighting as to form the likelihood. Perhaps, (some of) the data are separable or nearly so.

To get at this I would wrap the call in 'try' or one of its relatives and save out the data when the error is triggered to see what gives.

Another possibility is to run interaactively and set

         options( error=recover )

to try to take things apart.

HTH, Chuck

> all the code because it is very long. But I guess that this error message
> may have an "answer" whatever the code is?
> Thanks so much in advance!
> Willy
> [[alternative HTML version deleted]]

Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E	            UC San Diego La Jolla, San Diego 92093-0901 mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 14 Dec 2007 - 17:15:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 14 Dec 2007 - 18:30:18 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.