BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DanaM
Obsidian | Level 7

I'm using proc glimmix to analyze calves born and calves weaned but it gives me the error: "Data did not converge" when I have a nested variable in the model statement for calves born. The data is almost exactly the same for calves born and calves weaned, both are 0s and 1s with only a slight difference in the total amount of each between the variables, but for some reason proc glimmix will only converge my data for calves weaned with a nested variable. The models are exactly the same except for the dependent variable. They are:

 

birthed_calfnum= f2_animal_breed cow_age(f2_animal_birth_year) / dist=binomial link=logit;

random f2_animal_id;

 

and 

 

weaned_calfnum= f2_animal_breed cow_age(f2_animal_birth_year) / dist=binomial link=logit;

random f2_animal_id;

 

I've tried just running the model with the nested effect and upping the number of iterations but I still get the same error message. Does anyone have any idea what's going on and how to fix it? Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
STAT_Kathleen
SAS Employee

Please keep in mind each data set and model should be evaluated independently. Here are a few suggestions to try when you encounter the fail to converge message in the SAS LOG when using PROC GLIMMIX:

 

You can try some of the NLOPTIONS when you have convergence problems. For
example,

    NLOPTIONS TECHNIQUE=NRRIDG; or NLOPTIONS TECH=NEWRAP;

and see if that helps your model to converge.  Using NLOPTIONS=NRRIDG; for Binary, Binomial, Poisson, NegBin seems to help convergence.

 

 If your variables or parameter estimates are of wildly different scales (like .0001 vs 100) then you may need to rescale your data or your model.

 

Try different starting values for your random effects by adding a PARMS statement.  

 

You can also try adding the INITGLM option to the PROC GLIMIMX statement.

 

Examine the iteration history, does it look like it is making progress toward convergence. At the end (19 + 1initial optimizations is the default) if you are oh-so-close but do not quite make the convergence criteria. I would suggest that you  increase the MAXOPT= in the PROC statement to 50 to see if your model converges. You can also increase the MAXITER= option on the NLOPTIONS statement to increase the number of iterations.

 

Try different METHODs= Laplace etc  on PROC GLIMMIX statement such as METHOD=LAPLACE or QUAD if you are using SAS 9.2 or later for conditional model.

 

You may have to reconsider your model and simplify it.  You may have to use simpler TYPE= structure as in your example TYPE=VC rather than TYPE=UN or you may have to reconsider the fixed effects.

View solution in original post

2 REPLIES 2
STAT_Kathleen
SAS Employee

Please keep in mind each data set and model should be evaluated independently. Here are a few suggestions to try when you encounter the fail to converge message in the SAS LOG when using PROC GLIMMIX:

 

You can try some of the NLOPTIONS when you have convergence problems. For
example,

    NLOPTIONS TECHNIQUE=NRRIDG; or NLOPTIONS TECH=NEWRAP;

and see if that helps your model to converge.  Using NLOPTIONS=NRRIDG; for Binary, Binomial, Poisson, NegBin seems to help convergence.

 

 If your variables or parameter estimates are of wildly different scales (like .0001 vs 100) then you may need to rescale your data or your model.

 

Try different starting values for your random effects by adding a PARMS statement.  

 

You can also try adding the INITGLM option to the PROC GLIMIMX statement.

 

Examine the iteration history, does it look like it is making progress toward convergence. At the end (19 + 1initial optimizations is the default) if you are oh-so-close but do not quite make the convergence criteria. I would suggest that you  increase the MAXOPT= in the PROC statement to 50 to see if your model converges. You can also increase the MAXITER= option on the NLOPTIONS statement to increase the number of iterations.

 

Try different METHODs= Laplace etc  on PROC GLIMMIX statement such as METHOD=LAPLACE or QUAD if you are using SAS 9.2 or later for conditional model.

 

You may have to reconsider your model and simplify it.  You may have to use simpler TYPE= structure as in your example TYPE=VC rather than TYPE=UN or you may have to reconsider the fixed effects.

DanaM
Obsidian | Level 7
Thanks! I was able to get it to run using laplace

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 2184 views
  • 1 like
  • 2 in conversation