Announcement

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

  • xtreg, fe -- equivalence using mixed?

    Hi:

    What would be the equivalent of a fixed effect (within estimator) regression in terms of the mixed command?

    More specifically, if I have:
    xtset id
    xtreg y x t , fe

    where x is a continuous, time-varying predictor, and t is the wave number.

    What would be the equivalent of this using 'mixed'?

    I'm studying both multilevel modeling and fixed effect models (within the econometrics tradition), and I'm trying to examine the differences/similarities.

    Thanks.
    Edgar K.

  • #2
    Edgar:
    -mixed- suite has to do with -re- models.
    The fixed part of -mixed- is reported before the double pipe sign.
    The literature on this topic is too wide to be summarized in a post; however, the introductory section of -mixed- entry in Stata .pdf manual is, as always, a very good place to start.

    As far as -mixed- modesl are concerned, applied econometricians used to Stata can find pages 305-318 of http://www.stata.com/bookstore/micro...ata/index.html interesting (please note that the -mixed- was named -xtmixed- at those times).
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      The term fixed-effects is source of confusion because in the multi-level literature it has nothing to do with the within-estimator whereas these terms seem to be used as synonyms in economics.

      There is no direct way (as far as I know) to get the within estimates from mixed. You can, however, use so-called hybrid-modes or Mundlak's approach (do not have the reference now). This has been discussed in the forum several times. I explain the approach here. References are given two posts above.

      Best
      Daniel

      Comment


      • #4
        Great. Thanks both!

        Comment


        • #5
          Another way to approach this is through the LSDV route. Certainly, you can get fixed effects estimates using mixed!

          Code:
          . webuse grunfeld
          
          . xtset company year
                 panel variable:  company (strongly balanced)
                  time variable:  year, 1935 to 1954
                          delta:  1 year
          
          . xtreg mvalue invest kstock, fe
          
          Fixed-effects (within) regression               Number of obs     =        200
          Group variable: company                         Number of groups  =         10
          
          R-sq:                                           Obs per group:
               within  = 0.4117                                         min =         20
               between = 0.8078                                         avg =       20.0
               overall = 0.7388                                         max =         20
          
                                                          F(2,188)          =      65.78
          corr(u_i, Xb)  = 0.6955                         Prob > F          =     0.0000
          
          ------------------------------------------------------------------------------
                mvalue |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                invest |   2.856166   .3075147     9.29   0.000     2.249543    3.462789
                kstock |  -.5078673   .1403662    -3.62   0.000    -.7847625   -.2309721
                 _cons |   804.9802   32.43177    24.82   0.000     741.0033    868.9571
          -------------+----------------------------------------------------------------
               sigma_u |  905.81517
               sigma_e |  268.73329
                   rho |  .91910377   (fraction of variance due to u_i)
          ------------------------------------------------------------------------------
          F test that all u_i=0: F(9, 188) = 113.76                    Prob > F = 0.0000
          
          .  mixed mvalue invest kstock i.company || company:company
          
          Performing EM optimization: 
          
          Performing gradient-based optimization: 
          
          Iteration 0:   log likelihood = -1397.0161  
          Iteration 1:   log likelihood = -1396.4647  
          Iteration 2:   log likelihood = -1396.3446  
          Iteration 3:   log likelihood =  -1396.344  
          Iteration 4:   log likelihood =  -1396.344  
          
          Computing standard errors:
          
          Mixed-effects ML regression                     Number of obs     =        200
          Group variable: company                         Number of groups  =         10
          
                                                          Obs per group:
                                                                        min =         20
                                                                        avg =       20.0
                                                                        max =         20
          
                                                          Wald chi2(11)     =    4865.05
          Log likelihood =  -1396.344                     Prob > chi2       =     0.0000
          
          ------------------------------------------------------------------------------
                mvalue |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                invest |   2.856166   .2981465     9.58   0.000     2.271809    3.440522
                kstock |  -.5078673   .1360901    -3.73   0.000    -.7745989   -.2411356
                       |
               company |
                    2  |   -1977.37    89.2686   -22.15   0.000    -2152.334   -1802.407
                    3  |  -1074.162     149.63    -7.18   0.000    -1367.431   -780.8926
                    4  |  -2417.755   134.2108   -18.01   0.000    -2680.803   -2154.706
                    5  |  -2624.394   167.2513   -15.69   0.000    -2952.201   -2296.588
                    6  |  -2611.993   139.9913   -18.66   0.000    -2886.371   -2337.615
                    7  |  -2752.758   156.3585   -17.61   0.000    -3059.215   -2446.301
                    8  |  -2334.659   141.7045   -16.48   0.000    -2612.395   -2056.924
                    9  |  -2561.256   156.4413   -16.37   0.000    -2867.876   -2254.637
                   10  |  -2861.429   146.0994   -19.59   0.000    -3147.779    -2575.08
                       |
                 _cons |   2926.558   134.3752    21.78   0.000     2663.187    3189.929
          ------------------------------------------------------------------------------
          
          ------------------------------------------------------------------------------
            Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
          -----------------------------+------------------------------------------------
          company: Independent         |
                          var(company) |   8.92e-22          .             .           .
                            var(_cons) |   1.92e-19          .             .           .
          -----------------------------+------------------------------------------------
                         var(Residual) |   67884.52          .             .           .
          ------------------------------------------------------------------------------
          LR test vs. linear model: chi2(2) = 0.00                  Prob > chi2 = 1.0000
          
          Note: LR test is conservative and provided only for reference.
          
          . 

          Comment

          Working...
          X