Hi All,

I'm using STATA 15.

My problem is that I see different results when I run the same random-intercept only mixed effects model, but where I run one (i) using the "eststo", prefix and the other (ii) without any prefix, ie "mixed absenty_p bmim || grade: " only. My code is below. Please let me know if I can clarify, thank you so much

Q: Would someone have an idea why the models report different fixed-effects and random-effects results?


Code:
. mixed absenty_p bmim || grade:

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log likelihood =  3895.8906  
Iteration 1:   log likelihood =  3895.8906  

Computing standard errors:

Mixed-effects ML regression                     Number of obs     =      2,676
Group variable: grade                           Number of groups  =          9

                                                Obs per group:
                                                              min =        225
                                                              avg =      297.3
                                                              max =        343

                                                Wald chi2(1)      =       0.08
Log likelihood =  3895.8906                     Prob > chi2       =     0.7762

------------------------------------------------------------------------------
   absenty_p |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        bmim |   .0000584   .0002054     0.28   0.776    -.0003441    .0004609
       _cons |   .0564974   .0050627    11.16   0.000     .0465748    .0664201
------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
grade: Identity              |
                  var(_cons) |   .0000597   .0000336      .0000198      .00018
-----------------------------+------------------------------------------------
               var(Residual) |   .0031639   .0000866      .0029986    .0033384
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 29.82         Prob >= chibar2 = 0.0000

. predict randint0, reffects
(570 missing values generated)

. graph hbar (mean) randint0, over(grade) ytitle("Random Intercepts by Grade")

. eststo: mixed absenty_p bmim || grade: 

Performing EM optimization: 

Performing gradient-based optimization: 

Iteration 0:   log restricted-likelihood =    3883.39  
Iteration 1:   log restricted-likelihood =    3883.39  

Computing standard errors:

Mixed-effects REML regression                   Number of obs     =      2,676
Group variable: grade                           Number of groups  =          9

                                                Obs per group:
                                                              min =        225
                                                              avg =      297.3
                                                              max =        343

                                                Wald chi2(1)      =       0.11
Log restricted-likelihood =    3883.39          Prob > chi2       =     0.7432

------------------------------------------------------------------------------
   absenty_p |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        bmim |   .0000674   .0002057     0.33   0.743    -.0003357    .0004705
       _cons |   .0563113   .0051681    10.90   0.000      .046182    .0664406
------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
grade: Identity              |
                  var(_cons) |   .0000689   .0000403      .0000219    .0002167
-----------------------------+------------------------------------------------
               var(Residual) |   .0031651   .0000867      .0029996    .0033396
------------------------------------------------------------------------------
LR test vs. linear model: chibar2(01) = 31.86         Prob >= chibar2 = 0.0000
(est5 stored)