Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to obtain AIC and BIC after random effect

    Hi,
    After running a random effect model (xtreg vars , re), I type estat ic but I get this message: likelihood information not found in last estimation results. How could I get AIC and BIC?
    Many many thanks.

  • #2
    You can't. The AIC and BIC are both calculated from the log-likelihood of the model. But -xtreg, re- is not estimated by maximum likelihood, so there is no log-likelihood, and hence no AIC or BIC. They are simply not defined for this model.

    Added: if having an AIC and BIC are important for your research goals, you can use a different analysis. Instead of using -xtreg, re-, use -mixed-. For a two-level model, -xtreg, re- and -mixed- estimate the same model, but -mixed- estimates it using maximum likelihood. After -mixed-, you can then use -estat ic- to get AIC and BIC. Note: although -xtreg, re- and -mixed- estimate the same model, because they use different estimation procedures the results are not necessarily going to be identical. They should be very close, however.
    Last edited by Clyde Schechter; 27 Dec 2017, 14:35.

    Comment


    • #3
      Dear Clyde,
      Thank you so much for this.
      Best

      Comment


      • #4
        Clyde Schechter How come you can compute AIC and BIC after regression then?

        Comment


        • #5
          Felix:
          elaborating on Clyde's helpful advice, you can take a look at the following toy-example:
          Code:
          . use "https://www.stata-press.com/data/r16/nlswork.dta"
          (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
          
          . xtreg ln_wage c.age##c.age, vce(cluster idcode) mle
          
          Fitting constant-only model:
          Iteration 0:   log likelihood =  -12878.37
          Iteration 1:   log likelihood = -12864.036
          Iteration 2:   log likelihood = -12863.892
          Iteration 3:   log likelihood = -12863.892
          
          Fitting full model:
          Iteration 0:   log likelihood = -11322.802
          Iteration 1:   log likelihood = -11264.949
          Iteration 2:   log likelihood = -11264.776
          Iteration 3:   log likelihood = -11264.776
          
          Random-effects ML regression                    Number of obs     =     28,510
          Group variable: idcode                          Number of groups  =      4,710
          
          Random effects u_i ~ Gaussian                   Obs per group:
                                                                        min =          1
                                                                        avg =        6.1
                                                                        max =         15
          
                                                          Wald chi2(2)      =    1261.77
          Log likelihood  = -11264.776                    Prob > chi2       =     0.0000
          
                                       (Std. Err. adjusted for 4,710 clusters in idcode)
          ------------------------------------------------------------------------------
                       |               Robust
               ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   age |   .0592303   .0041053    14.43   0.000     .0511842    .0672765
                       |
           c.age#c.age |  -.0006789   .0000688    -9.87   0.000    -.0008137   -.0005441
                       |
                 _cons |    .545105   .0587335     9.28   0.000     .4299895    .6602205
          -------------+----------------------------------------------------------------
              /sigma_u |    .357561   .0048399                      .3481996     .367174
              /sigma_e |   .3031159   .0036457                       .296054    .3103463
                   rho |   .5818521   .0092125                      .5637158    .5998159
          ------------------------------------------------------------------------------
          
          . estat ic
          
          Akaike's information criterion and Bayesian information criterion
          
          -----------------------------------------------------------------------------
                 Model |          N   ll(null)  ll(model)      df        AIC        BIC
          -------------+---------------------------------------------------------------
                     . |     28,510  -12863.89  -11264.78       5   22539.55   22580.84
          -----------------------------------------------------------------------------
          Note: BIC uses N = number of observations. See [R] BIC note.
          
          .
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Thanks Carlo, my point or confusion was that aic and bic are also reported for non mle models

            Code:
            use "https://www.stata-press.com/data/r16/nlswork.dta"
            reg ln_wage c.age##c.age, robust
            Linear regression                               Number of obs     =     28,510
                                                            F(2, 28507)       =    1532.84
                                                            Prob > F          =     0.0000
                                                            R-squared         =     0.0882
                                                            Root MSE          =     .45654
            
            ------------------------------------------------------------------------------
                         |               Robust
                 ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                     age |   .0855891   .0036933    23.17   0.000       .07835    .0928282
                         |
             c.age#c.age |  -.0010982   .0000629   -17.46   0.000    -.0012215   -.0009749
                         |
                   _cons |   .1647917   .0520218     3.17   0.002     .0628265    .2667568
            ------------------------------------------------------------------------------
            
            
            estat ic
            
            
            Akaike's information criterion and Bayesian information criterion
            
            -----------------------------------------------------------------------------
                   Model |          N   ll(null)  ll(model)      df        AIC        BIC
            -------------+---------------------------------------------------------------
                       . |     28,510  -19415.15  -18098.45       3   36202.91   36227.68
            -----------------------------------------------------------------------------

            Comment


            • #7
              Felix:
              see https://stats.stackexchange.com/ques...linear-regress.
              Probably for -xtreg,re- the formula would be too complicated.
              Last edited by Carlo Lazzaro; 04 Feb 2021, 08:55.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment

              Working...
              X