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

# st: xtmixed: standard error calculation failed - Log Likelihood valid?

 From "Schmidt Alexander" To Subject st: xtmixed: standard error calculation failed - Log Likelihood valid? Date Thu, 3 May 2012 14:14:03 +0200

```Hello users,

I am trying to fit a hierarchical mixed model with xtmixed.
I have only 20 groups, so my df for the second level are quite limited.
However, when I include more than two random slopes I get the following output:

Performing EM optimization:

Iteration 0:   log likelihood =  -30145.49
Iteration 1:   log likelihood = -30145.082
Iteration 2:   log likelihood =  -30145.08

Computing standard errors:
standard-error calculation failed

Mixed-effects ML regression                     Number of obs      =     22697
Group variable: Country                         Number of groups   =        20

Obs per group: min =       481
avg =    1134.8
max =      1822

Wald chi2(21)      =   2289.74
Log likelihood =  -30145.08                     Prob > chi2        =    0.0000

-------------------------------------------------------------------------------
redincd_z |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
imbadeco_z |   .0422334   .0119448     3.54   0.000      .018822    .0656448
imbadclt_z |   -.028792   .0102362    -2.81   0.005    -.0488546   -.0087294
lrscale_z |  -.2005485   .0062901   -31.88   0.000    -.2128768   -.1882201
male |  -.1047215   .0123947    -8.45   0.000    -.1290147   -.0804282
agea_z |   .0390616    .008855     4.41   0.000     .0217061     .056417
agesq |  -.0195111   .0069855    -2.79   0.005    -.0332024   -.0058197
hinctnta_z |  -.1177657   .0077734   -15.15   0.000    -.1330012   -.1025301
educ1 |   .1012111   .0436147     2.32   0.020     .0157278    .1866945
educ2 |   .1237265   .0402994     3.07   0.002     .0447411     .202712
educ3 |   .0838198   .0387172     2.16   0.030     .0079355     .159704
educ5 |  -.1082862   .0391648    -2.76   0.006    -.1850479   -.0315246
bhealth |   .0672738   .0145339     4.63   0.000     .0387879    .0957596
married |   .0223739   .0139982     1.60   0.110    -.0050621    .0498099
emplstat1 |  -.0165358   .0183434    -0.90   0.367    -.0524883    .0194167
emplstat2 |  -.1097799   .0342492    -3.21   0.001    -.1769071   -.0426528
emplstat3 |   .0902096   .0334965     2.69   0.007     .0245577    .1558615
con_mig_z |   -.040176   .0470907    -0.85   0.394    -.1324721    .0521201
pro_wel_z |   .1222106   .0503462     2.43   0.015     .0235339    .2208874
social_esping |  -.1646089    .180994    -0.91   0.363    -.5193507    .1901329
cons_esping |   .2178327   .1544646     1.41   0.158    -.0849124    .5205778
eastern |   .2879099   .1531898     1.88   0.060    -.0123366    .5881563
_cons |  -.0693932    .145979    -0.48   0.635    -.3555068    .2167205
-------------------------------------------------------------------------------

------------------------------------------------------------------------------
Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
Country: Unstructured        |
var(imbade~z) |   .0015712          .             .           .
var(imbadc~z) |   .0007214          .             .           .
var(_cons) |   .0361669          .             .           .
cov(imbade~z,_cons) |  -.0023431          .             .           .
cov(imbadc~z,_cons) |   .0006795          .             .           .
-----------------------------+------------------------------------------------
var(Residual) |   .8299551          .             .           .
------------------------------------------------------------------------------
LR test vs. linear regression:       chi2(6) =   800.77   Prob > chi2 = 0.0000

Obviously, Stata cannot determine the standard errors of the random components.
So, my first question is: Can I trust the point estimates or do I have a really series problem with my model?
Please note that the problem does not occur during the optimization but after the Log Likelihood has converged.

Second, if I use an independent covariance structure (all covariance restricted to be zero), I get standard errors for the random effects and xtmixed reports no problems.

So, my question is: Can I use a LR Test to compare the Log-Likelihood of the model with free covariances to the model with restricted covariances?
The idea is to show that the model with restricted covariances performs as good as the model with free covariances. Then, I could simply select the model with restricted covariances and I would have a model that can be estimated including the standard errors.

However, when I use stata's lrtest command to compare the two models, stata says "mixed models are not nested". This error occurs only if the standard errors cannot be estimated. Usually, lrtest can, of course, be used to compare models with different random effect specifications.

So, what do you think? Does stata refuse to perform the test for any substantial reasons? If not, I would perform the test by hand.
In other words, do you think the Log Likelihood of the model which fails to give standard errors is valid and can be used to compare it with other models?

Alexander

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```