Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Nested Effect Causes "Did not converge" Error in Proc Glimmix

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 12-09-2020 03:21 PM
(1983 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thanks! I was able to get it to run using laplace

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

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.