[R] Apparent problem with coxph

lhunsicker at mchsi.com lhunsicker at mchsi.com
Tue Dec 7 00:33:24 CET 2010

Good evening, folks:

I am trying to run a bootstrap on a CoxPH regression.  I have set up a 1,000 x 1,000 matrix of "cases" and am running 1,000 analyses of 1,000 cases each.  The loop keeps breaking because of an error, and I have more or less isolated the problem to a call of the coxph function with a subset of the cases.

Specifically, I am trying to regress a survival against poly(CREAT6MO,4).

I located one of the specific runs where the code was breaking and copied this to "anomaly1".  (Most of the runs work fine.  About 1 in 20 seems to fail.)

There are no missing or out of range values for TTFAIL, FFAIL, or CREAT6MO in anomaly1.

poly(anomaly1$CREAT6MO,4) runs fine, with no error.  

But  -- coxph(Surv(TTFAIL - 182, FFAIL) ~ poly(CREAT6MO,4), data = anomaly1) 

fails with the following error code.

Error in fitter(X, Y, strats, offset, init, control, weights = weights,  : 
  NA/NaN/Inf in foreign function call (arg 6)
In addition: Warning message:
In fitter(X, Y, strats, offset, init, control, weights = weights,  :
  Ran out of iterations and did not converge

traceback() gives:

3: .C("coxmart", as.integer(n), as.integer(method == "efron"), stime, 
       sstat, newstrat, as.double(score), as.double(weights), resid = double(n))
2: fitter(X, Y, strats, offset, init, control, weights = weights, 
       method = method, row.names(m))
1: coxph(Surv(TTFAIL - 182, FFAIL) ~ poly(CREAT6MO, 4), data = anomaly1)

This problem seems to be "above my payline."  Any suggestions, anyone?

As always, many thanks in advance to any help that any of you can give me.

Larry Hunsicker

More information about the R-help mailing list