Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# st: xtmixed does not converge after 12 hours

 From Raquel Rangel de Meireles Guimarães To statalist@hsphsun2.harvard.edu Subject st: xtmixed does not converge after 12 hours Date Mon, 18 Jul 2011 03:11:04 -0300

```Hi all,

```
I wonder what to do when my hierarchical model does not converge. Below are two examples of unsuccessful models: the first did not converge after 12 hours, and the second could not estimate the standard error of the random effects. Is there an algorithm to maximize that is robust and can solve this problem?
```

------------------------------------------------
```
. xtmixed matematica masculino branco pardo atrasado nse if ano==2007 || escola: nse_escola atraso_escola
```
Performing EM optimization:

Iteration 0:   log restricted-likelihood =  -10997238
Iteration 1:   log restricted-likelihood =  -10996463
Iteration 2:   log restricted-likelihood =  -10996431
Iteration 3:   log restricted-likelihood =  -10996429
numerical derivatives are approximate
flat or discontinuous region encountered
Iteration 4:   log restricted-likelihood =  -10996428
numerical derivatives are approximate
flat or discontinuous region encountered
Iteration 5:   log restricted-likelihood =  -10996428
Iteration 6:   log restricted-likelihood =  -10996428
Iteration 7:   log restricted-likelihood =  -10996428
Iteration 8:   log restricted-likelihood =  -10996428
Iteration 9:   log restricted-likelihood =  -10996428
Iteration 10:  log restricted-likelihood =  -10996428

Computing standard errors:
standard-error calculation failed

```
Mixed-effects REML regression Number of obs = 2161701 Group variable: escola Number of groups = 37324
```
```
Obs per group: min = 1 avg = 57,9 max = 536
```

```
Wald chi2(5) = 87370,55 Log restricted-likelihood = -10996428 Prob > chi2 = 0,0000
```
------------------------------------------------------------------------------
```
matematica | Coef. Std. Err. z P>|z| [95% Conf. Interval]
```-------------+----------------------------------------------------------------
```
masculino | 2,978831 ,0533462 55,84 0,000 2,874275 3,083388 branco | 9,053575 ,0892833 101,40 0,000 8,878583 9,228567 pardo | 8,989271 ,085402 105,26 0,000 8,821887 9,156656 atrasado | -16,15816 ,0623462 -259,17 0,000 -16,28035 -16,03596 nse | 1,900536 ,0451125 42,13 0,000 1,812117 1,988955 _cons | 187,3911 ,128128 1462,53 0,000 187,14 187,6422
```------------------------------------------------------------------------------

------------------------------------------------------------------------------
```
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
```-----------------------------+------------------------------------------------
escola: Independent          |
```
sd(nse_es~a) | ,0024835 . . . sd(atraso~a) | ,000062 . . . sd(_cons) | 17,21811 . . .
```-----------------------------+------------------------------------------------
```
sd(Residual) | 38,40556 . . .
```------------------------------------------------------------------------------
```
LR test vs. linear regression: chi2(3) = 2,7e+05 Prob > chi2 = 0,0000
```
Note: LR test is conservative and provided only for reference.

----------------------------------------------------------------------------------------------------------

```
xtmixed leitura masculino branco pardo atrasado nse if ano==2007|| escola: nse_escola atraso_escola
```
Performing EM optimization:

Iteration 0:   log restricted-likelihood =  -10844088
Iteration 1:   log restricted-likelihood =  -10843330
Iteration 2:   log restricted-likelihood =  -10843299
Iteration 3:   log restricted-likelihood =  -10843297
Iteration 4:   log restricted-likelihood =  -10843297
Iteration 5:   log restricted-likelihood =  -10843297
Iteration 6:   log restricted-likelihood =  -10843297  (backed up)
Iteration 7:   log restricted-likelihood =  -10843297  (backed up)
Iteration 8:   log restricted-likelihood =  -10843297  (backed up)
Iteration 9:   log restricted-likelihood =  -10843297  (backed up)
Iteration 10:  log restricted-likelihood =  -10843297  (backed up)
Iteration 11:  log restricted-likelihood =  -10843297  (backed up)
Iteration 12:  log restricted-likelihood =  -10843297  (backed up)
Iteration 13:  log restricted-likelihood =  -10843297  (backed up)
Iteration 14:  log restricted-likelihood =  -10843297  (backed up)
Iteration 15:  log restricted-likelihood =  -10843297  (backed up)
Iteration 16:  log restricted-likelihood =  -10843297  (backed up)
Iteration 17:  log restricted-likelihood =  -10843297  (backed up)
Iteration 18:  log restricted-likelihood =  -10843297  (backed up)
Iteration 19:  log restricted-likelihood =  -10843297  (backed up)
Iteration 20:  log restricted-likelihood =  -10843297  (backed up)
Iteration 21:  log restricted-likelihood =  -10843297  (backed up)
Iteration 22:  log restricted-likelihood =  -10843297  (backed up)
Iteration 23:  log restricted-likelihood =  -10843297  (backed up)
Iteration 24:  log restricted-likelihood =  -10843297  (backed up)
Iteration 25:  log restricted-likelihood =  -10843297  (backed up)
Iteration 26:  log restricted-likelihood =  -10843297  (backed up)
Iteration 27:  log restricted-likelihood =  -10843297  (backed up)
Iteration 28:  log restricted-likelihood =  -10843297  (backed up)
Iteration 29:  log restricted-likelihood =  -10843297  (backed up)
Iteration 30:  log restricted-likelihood =  -10843297  (backed up)
Iteration 31:  log restricted-likelihood =  -10843297  (backed up)
Iteration 32:  log restricted-likelihood =  -10843297  (backed up)
Iteration 33:  log restricted-likelihood =  -10843297  (backed up)
Iteration 34:  log restricted-likelihood =  -10843297  (backed up)
Iteration 35:  log restricted-likelihood =  -10843297  (backed up)
Iteration 36:  log restricted-likelihood =  -10843297  (backed up)
--Break--
r(1);

--
Raquel Rangel de Meireles Guimarães
Professora Substituta do Departamento de Demografia, UFMG
Doutoranda em Demografia