Announcement

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

  • Interpreting fixed effects for a panel

    Hi,
    I am working with a panel data set which is xtset at the district year level. With district and year fixed effects, does the interpretation amount to examining variation within districts in the same year?

    Thanks.

  • #2
    Adrienne:
    not quite.
    Under the -fe- specification, coefficients report variation of time varying predictors within the same panel as years go by (that is, along the entire time span -t-).
    If you want to compare variation between different panels as time stretches over, you should go -be- or, more frequently, -re-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      I'm not sure I understand then what the difference between controlling for district and year fixed effects via something like i.district and i.year versus using the xt option with "fe" specified is.

      Comment


      • #4
        Adrienne:
        you probably meant what's the difference between:
        Code:
        regress <regressand> <regressors> i.panelid i.time
        vs

        Code:
         xtset panelid time
        xtreg <regressand> <regressors> i.time, fe
        Despite the coefficient will be the same (set aside for -paneild- which will be not estimated in -xtreg,fe-), the second approach gives you an insight about the existence of a panel-wise effect (sigma_u) along with its significance (F-test appearing as a footnote of the -xtreg, fe- outcome table), something that you cannot get from -regress-, as you can see from the following toy-example:
        Code:
        . use "http://www.stata-press.com/data/r15/nlswork.dta"
        (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
        
        . regress ln_wage i.idcode i.year age if idcode<=4
        
              Source |       SS           df       MS      Number of obs   =        50
        -------------+----------------------------------   F(18, 31)       =      1.19
               Model |  2.96881764        18  .164934314   Prob > F        =    0.3290
            Residual |  4.31127709        31  .139073454   R-squared       =    0.4078
        -------------+----------------------------------   Adj R-squared   =    0.0639
               Total |  7.28009473        49  .148573362   Root MSE        =    .37293
        
        ------------------------------------------------------------------------------
             ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
              idcode |
                  2  |    -.34821   .1544058    -2.26   0.031    -.6631228   -.0332973
                  3  |  -1.996997   2.662102    -0.75   0.459     -7.42639    3.432395
                  4  |  -1.597003   2.699068    -0.59   0.558    -7.101788    3.907781
                     |
                year |
                 69  |  -.0536729   .6925589    -0.08   0.939    -1.466156     1.35881
                 70  |  -.5622491   .9779883    -0.57   0.570    -2.556869    1.432371
                 71  |  -.9270145   1.387092    -0.67   0.509    -3.756008    1.901979
                 72  |  -1.063298   1.819443    -0.58   0.563    -4.774076     2.64748
                 73  |  -1.228195   2.258252    -0.54   0.590     -5.83393     3.37754
                 75  |  -1.704501   3.144409    -0.54   0.592    -8.117565    4.708562
                 77  |  -2.312608   4.040225    -0.57   0.571     -10.5527    5.927484
                 78  |  -2.367822   4.486708    -0.53   0.601    -11.51852     6.78288
                 80  |  -3.040105   5.376662    -0.57   0.576    -14.00588     7.92567
                 82  |  -3.763953   6.275703    -0.60   0.553    -16.56333    9.035427
                 83  |  -3.803244   6.719895    -0.57   0.575    -17.50856    9.902073
                 85  |  -4.165837   7.616051    -0.55   0.588    -19.69888     11.3672
                 87  |  -4.750318   8.512544    -0.56   0.581    -22.11177    12.61113
                 88  |  -5.133582   9.297175    -0.55   0.585     -24.0953    13.82813
                     |
                 age |   .2626399   .4488774     0.59   0.563    -.6528517    1.178131
               _cons |  -2.287519   7.228638    -0.32   0.754    -17.03042    12.45539
        ------------------------------------------------------------------------------
        
        . xtset idcode year
               panel variable:  idcode (unbalanced)
                time variable:  year, 68 to 88, but with gaps
                        delta:  1 unit
        
        . xtreg ln_wage i.year age if idcode<=4, fe
        
        Fixed-effects (within) regression               Number of obs     =         50
        Group variable: idcode                          Number of groups  =          4
        
        R-sq:                                           Obs per group:
             within  = 0.1909                                         min =         11
             between = 0.0349                                         avg =       12.5
             overall = 0.0044                                         max =         15
        
                                                        F(15,31)          =       0.49
        corr(u_i, Xb)  = -0.9582                        Prob > F          =     0.9290
        
        ------------------------------------------------------------------------------
             ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                year |
                 69  |  -.0536729   .6925589    -0.08   0.939    -1.466156     1.35881
                 70  |  -.5622491   .9779883    -0.57   0.570    -2.556869    1.432371
                 71  |  -.9270145   1.387092    -0.67   0.509    -3.756008    1.901979
                 72  |  -1.063298   1.819443    -0.58   0.563    -4.774076     2.64748
                 73  |  -1.228195   2.258252    -0.54   0.590     -5.83393     3.37754
                 75  |  -1.704501   3.144409    -0.54   0.592    -8.117565    4.708562
                 77  |  -2.312608   4.040225    -0.57   0.571     -10.5527    5.927484
                 78  |  -2.367822   4.486708    -0.53   0.601    -11.51852     6.78288
                 80  |  -3.040105   5.376662    -0.57   0.576    -14.00588     7.92567
                 82  |  -3.763953   6.275703    -0.60   0.553    -16.56333    9.035427
                 83  |  -3.803244   6.719895    -0.57   0.575    -17.50856    9.902073
                 85  |  -4.165837   7.616051    -0.55   0.588    -19.69888     11.3672
                 87  |  -4.750318   8.512544    -0.56   0.581    -22.11177    12.61113
                 88  |  -5.133582   9.297175    -0.55   0.585     -24.0953    13.82813
                     |
                 age |   .2626399   .4488774     0.59   0.563    -.6528517    1.178131
               _cons |  -3.321529   8.616061    -0.39   0.702     -20.8941    14.25104
        -------------+----------------------------------------------------------------
             sigma_u |  .96166721
             sigma_e |  .37292553
                 rho |  .86927679   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        F test that all u_i=0: F(3, 31) = 4.30                       Prob > F = 0.0120
        
        .
        In sum, when you have panel data analysis and you want to go -fe- (provided that this is the right specification for your model), you should start from -xtreg,fe- instead from -regress- with -i.panelid-.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X