Elisabetta Petracci
2016-Sep-05 09:42 UTC
[R] conditional gap time frailty cox model for recurrent events
Dear users, I am fitting a conditional gap time frailty cox model weighting observations by means of inverse probability time dependent weigths. Attached find the self-explaining dataset. I have used the following sintax: coxph(Surv(gaptstart,gaptstop,status)~treat+strata(nrecord01)+frailty(id,distribution="gamma",method="em"), data=dataNOTDrr,weights=dataNOTDrr$weight) And I get the following warning: Warning message: In coxpenal.fit(X, Y, strats, offset, init = init, control, weights weights, : Inner loop failed to coverge for iterations 3 4 I have tried to: - leave out the weights but I get the error anyway - to randomly select a subset of patients and I don't get the error. This seems to suggest that the problem is with some observations. Any suggestion? Many thanks, Elisabetta
Göran Broström
2016-Sep-05 10:06 UTC
[R] conditional gap time frailty cox model for recurrent events
Dear Elisabetta, I have no direct answer to your question, but a suggestion: Use the 'coxme' function (in the package with the same name). In the help page for 'frailty' (survival) you will find: "The coxme package has superseded this method. It is faster, more stable, and more flexible." Hth, G?ran On 2016-09-05 11:42, Elisabetta Petracci wrote:> Dear users, > > I am fitting a conditional gap time frailty cox model weighting > observations by means of inverse probability time dependent weigths. > Attached find the self-explaining dataset. > > I have used the following sintax: > > coxph(Surv(gaptstart,gaptstop,status)~treat+strata(nrecord01)+frailty(id,distribution="gamma",method="em"), > data=dataNOTDrr,weights=dataNOTDrr$weight) > > > And I get the following warning: > > Warning message: > In coxpenal.fit(X, Y, strats, offset, init = init, control, weights > weights, : > Inner loop failed to coverge for iterations 3 4 > > > I have tried to: > - leave out the weights but I get the error anyway > - to randomly select a subset of patients and I don't get the error. This > seems to suggest that the problem is with some observations. > > Any suggestion? > > Many thanks, > > Elisabetta > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >