Announcement

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

  • Can you use fixed effects models for time-invariant, multilevel data?

    I would just like to ask whether fixed effects models can be used for time-invariant, multilevel data instead of panel data (as an alternative to multilevel modelling)? In this case dummy variables would be included for all level 2 units.

    My understanding is that the term, 'fixed effects', relates specifically to the units of observation and the panel data structure, but I don't see why this would be an issue for the model mathematically.


    Many thanks,

    Ozan

  • #2
    Ozan:
    welcome to this forum.
    The issue is that -mixed- is equivalent to -xtreg, mle- (an -re- estimator), as you can see from the following toy-example:
    Code:
    . use "https://www.stata-press.com/data/r18/nlswork.dta"
    (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
    
    . mixed ln_wage i.race, vce(cluster idcode)||idcode:
    
    Performing EM optimization ...
    
    Performing gradient-based optimization: 
    Iteration 0:  Log pseudolikelihood = -12817.312  
    Iteration 1:  Log pseudolikelihood = -12817.312  
    
    Computing standard errors ...
    
    Mixed-effects regression                             Number of obs    = 28,534
    Group variable: idcode                               Number of groups =  4,711
                                                         Obs per group:
                                                                      min =      1
                                                                      avg =    6.1
                                                                      max =     15
                                                         Wald chi2(2)     = 102.63
    Log pseudolikelihood = -12817.312                    Prob > chi2      = 0.0000
    
                                 (Std. err. adjusted for 4,711 clusters in idcode)
    ------------------------------------------------------------------------------
                 |               Robust
         ln_wage | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
            race |
          Black  |  -.1301537   .0131255    -9.92   0.000    -.1558792   -.1044283
          Other  |   .1006124   .0662975     1.52   0.129    -.0293284    .2305532
                 |
           _cons |   1.692089   .0069705   242.75   0.000     1.678427    1.705751
    ------------------------------------------------------------------------------
    
    ------------------------------------------------------------------------------
                                 |               Robust           
      Random-effects parameters  |   Estimate   std. err.     [95% conf. interval]
    -----------------------------+------------------------------------------------
    idcode: Identity             |
                      var(_cons) |   .1362594   .0037256      .1291495    .1437607
    -----------------------------+------------------------------------------------
                   var(Residual) |   .1031165   .0024214      .0984783    .1079732
    ------------------------------------------------------------------------------
    
    . xtreg ln_wage i.race, vce(cluster idcode) mle
    
    Fitting constant-only model:
    Iteration 0:  Log likelihood = -12883.463
    Iteration 1:  Log likelihood = -12869.087
    Iteration 2:  Log likelihood = -12868.942
    Iteration 3:  Log likelihood = -12868.942
    
    Fitting full model:
    Iteration 0:  Log likelihood = -12833.705
    Iteration 1:  Log likelihood = -12817.493
    Iteration 2:  Log likelihood = -12817.312
    Iteration 3:  Log likelihood = -12817.312
    
    Random-effects ML regression                         Number of obs    = 28,534
    Group variable: idcode                               Number of groups =  4,711
    
    Random effects u_i ~ Gaussian                        Obs per group:
                                                                      min =      1
                                                                      avg =    6.1
                                                                      max =     15
    
                                                         Wald chi2(2)     = 102.63
    Log likelihood = -12817.312                          Prob > chi2      = 0.0000
    
                                 (Std. err. adjusted for 4,711 clusters in idcode)
    ------------------------------------------------------------------------------
                 |               Robust
         ln_wage | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
            race |
          Black  |  -.1301537   .0131265    -9.92   0.000    -.1558812   -.1044263
          Other  |   .1006124   .0663095     1.52   0.129    -.0293519    .2305767
                 |
           _cons |   1.692089   .0069623   243.04   0.000     1.678443    1.705735
    -------------+----------------------------------------------------------------
        /sigma_u |   .3691333   .0050312                      .3594028    .3791272
        /sigma_e |   .3211176   .0037712                      .3138106    .3285947
             rho |   .5692276   .0091414                      .5512457    .5870672
    ------------------------------------------------------------------------------
    
    .
    Therefore, no wonder that coefficients of time-invariant predictors can be calculated.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Fixed effects estimation is often applied to non-panel structures. For example, you have students nested within schools for one years. You can include school fixed effects to estimate coefficients on variables that change at the student level. And then cluster by school.

      Comment

      Working...
      X