[R] error using try() and coxph()

vito muggeo vito.muggeo at giustizia.it
Tue Mar 4 14:27:05 CET 2003


Dear all,
I'm experiencing some problems in using the following code to perform
simulations with Cox models (using coxph() in survival package):

for(i in 1:1000){
    dd<-....#simulate the dataframe
    o0<-try(coxph(Surv(start,stop,status)~x,data=dd))
    o1<-try(coxph(Surv(start,stop,status)~x+x:stop,data=dd))
    o2<-try(coxph(Surv(start,stop,status)~x+x:poly(stop,2),data=dd))
    ....
    }

The error (both in Rgui and in batch mode) causes R to crash immediately
with a DOS message like "Error in survival.dll"
Using coxph() without try() simulation stops because sometimes the model may
be not fitted, I get the explicit error message. Therefore I suspect that
the problem depends on using try(coxph(....)). Also note that using
try(arima(....)) for a similar problem works well.
versions: survival 2.9-4 and R 1.5.1 on WinMe
I know I should update R, but I wonder whether the problem depends on the
old version

Could anyone suggest me anything?

cheers,
vito




More information about the R-help mailing list