turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Error: "Did not converge" in Proc mixed

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-26-2016 08:12 PM

Hello All,

I was trying to see the climate moisture trend over time for combined sites using proc mixed LMM. However, when I tried to model it with the following command than an error occurred. It said **"Did not converge****.**" I have applied the same model for temperature and it was successful. But not for climate moisture data. Please note that The climate moisture data have both negative and positive value. Can you please help me to solve the problem? Thanks. N.B access link to input data file https://www.dropbox.com/s/cgaws9lf7p5tkr1/cmi.xlsx?dl=0

```
proc mixed data= import;
class plot;
model cmi = plot plot*year;
run;
proc mixed data=import;
class plot;
model cmi = year / ddfm=kr solution outp=pred;
random int year / type=un subject=plot solution;
run;
proc sort data=pred;
by year;
run;
proc sgplot data=pred;
series y=pred x=year / group=plot;
run;
```

Accepted Solutions

Solution

01-27-2016
01:34 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-27-2016 12:23 PM

You can get this to converge in GLIMMIX (even with that extreme plot that was identified).

proc glimmix data=a ;

class plot;

model cmi = year / ddfm=kr solution ;

random int year / type=un subject=plot solution;

run;

GLIMMIX uses a different optimization method by default than MIXED. Converges in 18 iterations. A nice thing about GLIMMIX, you can use the NLOPTIONS statement to specify other optimization methods (wasn't needed here). To get output, use the OUTPUT statement (the out option on the model statement is not used in GLIMMIX).

If you look at the output, you will see that the UN(2,2) variance, the variance of slope, is basically 0. This results in missing values for standard errors of parameter estimates and the EBLUPS. Results suggest an overparameterized model for this response variable. You could reduce the random effect to a random intercept model.

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-27-2016 10:32 AM

There are many reasons for lack of convergence. You might be getting close before the iteration limit is reached. Suggest you add these options to the procedure statement:

maxiter=1000 maxfunc=1000

You should look at the iteration history to see if the algorithm is getting close to convergence, but is jumping around a lot in terms of the "objective". You could see if convergence is achieved if you relax theconvergence criterion to

convg=1e-6

(the default is convg=1e-8). The latter is a bit dangerous, because you may not be at the optimum solution. But this can help in checking things out.

You are fitting a straight-line model to the data. If the moisture trend with year is not very straight, then convergence would also be an issue.

Solution

01-27-2016
01:34 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-27-2016 12:23 PM

You can get this to converge in GLIMMIX (even with that extreme plot that was identified).

proc glimmix data=a ;

class plot;

model cmi = year / ddfm=kr solution ;

random int year / type=un subject=plot solution;

run;

GLIMMIX uses a different optimization method by default than MIXED. Converges in 18 iterations. A nice thing about GLIMMIX, you can use the NLOPTIONS statement to specify other optimization methods (wasn't needed here). To get output, use the OUTPUT statement (the out option on the model statement is not used in GLIMMIX).

If you look at the output, you will see that the UN(2,2) variance, the variance of slope, is basically 0. This results in missing values for standard errors of parameter estimates and the EBLUPS. Results suggest an overparameterized model for this response variable. You could reduce the random effect to a random intercept model.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-27-2016 11:59 AM - edited 01-27-2016 12:00 PM

Your data for Plot 78p1 is has a much larger range of data than the others. The model will converge when that plot is dropped from the analysis.

The MEANS Procedure Analysis Variable : cmi N plot Obs Maximum Minimum Std Dev 370p1 65 7.4853610 -2.2740591 2.1793967 591p1 65 5.3872819 -3.0432296 2.0862358 594p1 65 4.4959485 -3.6916214 1.7677325 608p1 65 9.0713372 -2.3283802 2.3539313 609p1 65 6.8631951 -3.3686982 1.9735248 610p1 65 6.5983618 -4.1104316 1.9757973 612p1 65 9.4677688 -2.5632169 2.5307261 613p1 65 3.6177264 -3.9495914 1.7285168 614p1 65 11.0386928 -1.1157220 2.7113059 615p1 65 3.3356982 -3.1275722 1.5254858 616p1 65 3.3269424 -3.2875238 1.5755983 618p1 65 3.4038994 -3.7400507 1.6946378 621p1 65 2.3974877 -3.6640138 1.4707218 622p1 65 6.2530576 -3.8531421 2.3320447 625p1 65 3.1951359 -4.0699301 1.7616092 626p1 65 7.8543502 -4.4866951 2.3123009 78p1 65 29.5117128 -39.5160676 15.9697975

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-27-2016 01:35 PM

Thanks

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11 hours ago

You can try to **proc sort** your dependent variable.

proc sort data = import; by cmi; run;