07-23-2014 08:04 AM
I am modelling hospital mortality data (dichotomous rsponse variable) using GLIMMIX at three levels: patient, doctor, hospital. I have over 3million patients, about 80,000 doctors and about 70 hospitals. My code looks like:
proc glimmix data=mortality method=quad;
class doctor hospital;
model death(event=1)= patient_covariates hospital_covariates doctor_covariates doctor hospital/dist=b s;
random intercept/ subject=hospital;
random intecept /subject=doctor(hospital);
I can not make this model to converge. I wonder whether I have too many levels on the 'doctor' variable which has so many lavels?
Any help would be appreciated!
07-23-2014 10:05 AM
That is a possibility. One thing you might try is giving each doctor a unique NUMERICAL id, and then removing doctor from the class statement. I would also remove the fixed effects of doctor and hospital from the MODEL statement. Also, change from dist=b, which is a binomial and more suited to aggregated data, to dist=binary, to reflect the 0/1 nature of your data. Consider changing from method=quad to method=laplace. And finally, when you say that the model does not converge, I suspect that you are hitting the 20 iteration default and getting a message, rather than letting the procedure iterate as much as needed. Try adding and NLOPTIONS statement:
07-25-2014 05:48 AM
I made all the suggested changes (except making my DOCTOR_ID
Numerical). I am happy to report that the code has
converged (GCONV=1E-8) as displayed in my Log window, HOWEVER,
it is taking a very long time to finish. I set the code running yesterday at
4pm(GMT) and it is still running… 18hrs and counting. I am very tempted
to let it run over the weekend, but wonder whether it is really working or has
it got stuck somewhere? No error messages though.
07-28-2014 10:26 AM
There is a good chance that the likelihood is in a very flat space and is essentially just thrashing around a fixed point. You might try adding:
to the proc glimmix call. If all parameters are relatively stable (which is what this checks) you should be good.