[R] "Ran out of iterations and did not converge"

aydan aaatopcu at gmail.com
Sat Mar 12 15:13:12 CET 2011


Hello R users,
I'm trying to do simulations for comparing cox and weibull 
I have come across this problem:

Warning messages:

1: In survreg.fit(X, Y, weights, offset, init = init, controlvals = control, 
:
  Ran out of iterations and did not converge
2: In survreg.fit(X, Y, weights, offset, init = init, controlvals = control, 
:
  Ran out of iterations and did not converge

what i did is fallowing


simulasyon<-function(x,oran){
+ y<-rexp(length(oran),rate=oran)
+ z<-rexp(length(oran),rate=1/oran)
+ e1<-coxph(Surv(y,rep(1,length(oran)))~x)
+ e2<-survreg(Surv(z,rep(1,length(oran)))~x,dist="weibull")
+ return(c(e1$coef,e2$coef[2]))
+ }

result<-matrix(NA, nrow=2, ncol=100)
> for(i in 1:100) result[,i]<-simulasyon(b,r)
b<-(1:50)/2-3
> r<-exp(3*b+1)
> simulasyon(b,r)
Warning messages:
1: In survreg.fit(X, Y, weights, offset, init = init, controlvals = control, 
:
  Ran out of iterations and did not converge
2: In survreg.fit(X, Y, weights, offset, init = init, controlvals = control, 
:
  Ran out of iterations and did not converge

Has anyone know what i did wrong or way to fix the problem? 
Thanks in advance, 
ayhan


--
View this message in context: http://r.789695.n4.nabble.com/Ran-out-of-iterations-and-did-not-converge-tp3350262p3350262.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list