Help using Base SAS procedures

too many categories for GLIMMIX?

Reply
Occasional Contributor
Posts: 5

too many categories for GLIMMIX?

Hi,

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);

run;

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!

Respected Advisor
Posts: 2,655

Re: too many categories for GLIMMIX?

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:

nloptions maxiter=1000;

Steve Denham


Occasional Contributor
Posts: 5

Re: too many categories for GLIMMIX?

Steve,

Thank you for all those suggestions. I will try them and get back here.

Best wishes.

Occasional Contributor
Posts: 5

Re: too many categories for GLIMMIX?

Steve,

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.

Regards

Respected Advisor
Posts: 2,655

Re: too many categories for GLIMMIX?

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:

pconv=1e-6

to the proc glimmix call.  If all parameters are relatively stable (which is what this checks) you should be good.

Steve Denham

Ask a Question
Discussion stats
  • 4 replies
  • 295 views
  • 4 likes
  • 2 in conversation