[R] NA/NaN/Inf in foreign function call (arg 6) error from coxph function

Cindy Yao cindyyao0301 at gmail.com
Wed Feb 13 16:46:12 CET 2013


Dear R-helpers:

I am trying to fit a multivariate Cox proportional hazards model,
modelling survival outcome as a function of treatment and receptor
status. The data look like below:

# structure of the data
str(sample.data)
List of 4
 $ survobj  : Surv [1:129, 1:2] 0.8925+ 1.8836+ 2.1191+ 5.3744+
1.6099+ 5.2567  0.2081+ 0.2108+ 0.2683+ 0.4873+ ...
  ..- attr(*, "dimnames")=List of 2
  .. ..$ : NULL
  .. ..$ : chr [1:2] "time" "status"
  ..- attr(*, "type")= chr "right"
 $ therapy  : Factor w/ 2 levels "treatment1","treatment2": 1 1 1 1 1
1 1 2 2 1 ...
 $ ReceptorA: Factor w/ 2 levels "0","1": 1 2 2 2 1 2 2 2 2 1 ...
 $ ReceptorB: Factor w/ 2 levels "0","1": 1 2 1 1 2 1 1 1 1 1 ...

But when I tried to fit a multivariate Cox proportional model, I got
the following error. I'm not quite what that means. Any help would be
much appreciated!

# perform multivariate Cox proportional hazards model
coxph(sample.data$survobj ~ sample.data$therapy +
sample.data$ReceptorA + sample.data$ReceptorB)

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

Best regards,
Cindy

 -- output of sessionInfo():

sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
[1] C

attached base packages:
[1] grid      splines   stats     graphics  grDevices datasets  utils
[8] methods   base

other attached packages:
 [1] MASS_7.3-23
 [2] hexbin_1.26.1
 [3] cluster_1.14.3
 [4] latticeExtra_0.6-24
 [5] RColorBrewer_1.0-5
 [6] lattice_0.20-13
 [7] survival_2.37-2

loaded via a namespace (and not attached):
[1] tools_2.15.2



More information about the R-help mailing list