samedi 15 mai 2021

No starting estimate was successful error with coxme upon data subsetting

I have a large dataset that I subsetted and created a new dataset. I used the following code that works perfectly

require(sjPlot);require(coxme)
tab_model(coxme(Surv(comp2_years, comp2)~FEMALE+(1|TRIAL), data))

But when I used the subsetted datas set using the following code,

www<- subset(data, (data$TRIAL != 5 & data$Sex.standerd.BMI.gpM1F2 >=1))
tab_model(coxme(Surv(comp2_years, comp2)~FEMALE+(1|TRIAL), www))

it gave me the following error:

Error in coxme.fit(X, Y, strats, offset, init, control, weights = weights,  : 
  No starting estimate was successful

This is my new data structure

 str(www)
Classes ‘data.table’ and 'data.frame':  7576 obs. of  79 variables:
 $ TRIAL                                                          : num  1 1 1 1 1 1 1 1 1 1 ...
 $ FEMALE                                                         : Factor w/ 2 levels "1","2": 1 1 1 1 1 1 1 1 1 1 ...
 $ type_comp2                                                     : chr  "0" "0" "Revasc" "0" ...
 $ comp2                                                          : num  0 0 1 0 0 0 0 0 0 1 ...
 $ comp2_years                                                    : num  10 10 9.77 10 10 ...
 $ Sex.standerd.BMI.gpM1F2                                        : num  1 1 1 1 1 1 1 1 1 1 ...
 $ Trial1_4.MiddleBMI                                             : num  1 1 1 1 1 1 1 1 1 1 ...
 - attr(*, ".internal.selfref")=<externalptr> 

I saw this post but I could not solve my current problem. Any advice will be greatly appreciated.




Aucun commentaire:

Enregistrer un commentaire