6
$\begingroup$

I have a data set

> head(data)
  id centre        u      time event x c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14
   1      1 0.729891 0.3300478     1 0  1  0  0  0  0  0  0  0  0   0   0   0   0   0
   2      1 0.729891 7.0100000     0 0  1  0  0  0  0  0  0  0  0   0   0   0   0   0
   3      1 0.729891 7.0150000     0 1  1  0  0  0  0  0  0  0  0   0   0   0   0   0
   4      1 0.729891 1.3616940     1 0  1  0  0  0  0  0  0  0  0   0   0   0   0   0
   5      1 0.729891 7.0250000     0 0  1  0  0  0  0  0  0  0  0   0   0   0   0   0
   6      1 0.729891 5.0824055     1 0  1  0  0  0  0  0  0  0  0   0   0   0   0   0

and I want to fit a proportional hazards model.

IN R

I first defined formula:

> formula
Surv(time, event) ~ x + c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + 
    c9 + c10 + c11 + c12 + c13 + c14

and I used the coxph function:

> library(survival)
> mod <- coxph(formula, data=data)
Erreur dans fitter(X, Y, strats, offset, init, control, weights = weights,  : 
  NA/NaN/Inf dans un appel à une fonction externe (argument 6)
De plus : Message d'avis :
In fitter(X, Y, strats, offset, init, control, weights = weights,  :
  Ran out of iterations and did not converge

IN SAS

I used proc phreg:

proc phreg data=data;
    model time*event(0) = x c1-c14 / ties=breslow;
run;

Partial output:

                      Convergence Status

                     Convergence criterion (GCONV=1E-8) satisfied.

Question:

  • Do you have any suggestion to make it work in R?

I have tried to increase iter.max but the problem is still there... If needed, I can provide the data (600 rows).

$\endgroup$
4
  • 1
    $\begingroup$ What about changing of the starting values? Supply to init similar values to the output of SAS and see what happens. $\endgroup$
    – mpiktas
    Commented May 6, 2011 at 8:31
  • 1
    $\begingroup$ @mpiktas: Thank you very much !!! It works ! I did not realize that the default initial value is zero for all variables in R. On the other hand, I have still to investigate what are the initial values in SAS. Again, Thank you very much !!! $\endgroup$
    – ocram
    Commented May 6, 2011 at 9:08
  • $\begingroup$ glad to be helpful :) Note this is a dirty cheat, since you use other software package to provide starting values, which is not feasible in the long run. But when debugging this is a first thing to try. $\endgroup$
    – mpiktas
    Commented May 6, 2011 at 9:23
  • $\begingroup$ @mpiktas Now, please, put this as an answer so that @ocram can accept it :-) $\endgroup$
    – chl
    Commented May 6, 2011 at 12:02

2 Answers 2

5
$\begingroup$

What about changing of the starting values? Supply to init similar values to the output of SAS and see what happens. This in general is not a good strategy to get the convergence, but it helps to see whether the problem is in algorithm, or just in starting values.

$\endgroup$
4
$\begingroup$

How many events are in the dataset? The fit from SAS may not be meaningful if there are fewer than a few multiples of the number of covariates (14).

In general with Cox regression I have not had to specify starting values but have occasionally played around with the convergence criteria.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.