Announcement

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

  • Why not including firm fixed effects in regression?

    What would be a valid argument not to include firm fixed effects in a regression for a panel dataset?

  • #2
    If you think there's no unobserved, unit-specific, time-stable confounding (spoiler: rarely is this the case). But see this paper here.

    Comment


    • #3
      What if I include year fixed effects, would you say it makes sense to additionally include firm fixed effects? The goal is to examine the change of leverage from each firm over time.

      Comment


      • #4
        According to the paper I've linked here, Stata (and R for that matter) do incorrect/misleading matrix algebraic calculations when we use both time and year dummies. The idea is that which set of FE you include changes the causal question you're answering and the identification of the coefficients. Quoting them directly,
        We are also the first to show both formally and with simulations that if we begin with the assumptions that many researchers bring to the two-way FE model—that it represents a single estimate of X on Y while accounting for unit-level heterogeneity and time shocks—this specification is in fact statistically unidentified. This concerning fact about twoway FE models has probably remained hidden for so long because statistical software packages like R and Stata employ hidden matrix processing to work around the unidentifiability. We urge researchers to choose between models by taking into consideration the way in which parameters must be interpreted. A correct answer to the wrong question is as useless as the wrong answer to the right question.

        Comment


        • #5
          Benjamin:
          are you talking about -regress- or -xtreg-?
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment


          • #6
            I'm talking about -xtreg-

            Comment


            • #7
              Benjamin:
              the following one is a trivial example that proves the unusefulness of including -i.code- if you go -xtreg,fe- (perfect collinearity with the -panelid):
              Code:
              . use "https://www.stata-press.com/data/r17/nlswork.dta"
              (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
              
              . xtreg ln_wage i.year i.idcode if idcode<=3, fe
              note: 2.idcode omitted because of collinearity.
              note: 3.idcode omitted because of collinearity.
              
              Fixed-effects (within) regression               Number of obs     =         39
              Group variable: idcode                          Number of groups  =          3
              
              R-squared:                                      Obs per group:
                   Within  = 0.5446                                         min =         12
                   Between = 0.2670                                         avg =       13.0
                   Overall = 0.3678                                         max =         15
              
                                                              F(14,22)          =       1.88
              corr(u_i, Xb) = -0.0356                         Prob > F          =     0.0897
              
              ------------------------------------------------------------------------------
                   ln_wage | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
              -------------+----------------------------------------------------------------
                      year |
                       69  |    .208967   .3918928     0.53   0.599    -.6037689    1.021703
                       70  |  -.2747772   .3439816    -0.80   0.433    -.9881514    .4385969
                       71  |  -.3613911    .326316    -1.11   0.280    -1.038129    .3153467
                       72  |  -.2056973    .326316    -0.63   0.535    -.8824352    .4710406
                       73  |  -.0310461    .326316    -0.10   0.925     -.707784    .6456917
                       75  |   .0416271    .326316     0.13   0.900    -.6351107     .718365
                       77  |   .0358937    .326316     0.11   0.913    -.6408441    .7126316
                       78  |   .2433199    .326316     0.75   0.464    -.4334179    .9200578
                       80  |   .2726139    .326316     0.84   0.412    -.4041239    .9493518
                       82  |   .1747839   .3439816     0.51   0.616    -.5385903    .8881581
                       83  |   .2924489    .326316     0.90   0.380    -.3842889    .9691868
                       85  |   .3712589    .326316     1.14   0.267     -.305479    1.047997
                       87  |   .2960361    .326316     0.91   0.374    -.3807017     .972774
                       88  |   .3038639    .326316     0.93   0.362    -.3728739    .9806018
                           |
                    idcode |
                        2  |          0  (omitted)
                        3  |          0  (omitted)
                           |
                     _cons |   1.659677   .2833366     5.86   0.000     1.072073    2.247281
              -------------+----------------------------------------------------------------
                   sigma_u |  .24956596
                   sigma_e |  .27711004
                       rho |  .44784468   (fraction of variance due to u_i)
              ------------------------------------------------------------------------------
              F test that all u_i=0: F(2, 22) = 9.64                       Prob > F = 0.0010
              
              .
              Kind regards,
              Carlo
              (StataNow 18.5)

              Comment


              • #8
                this is a very good thread. i'm quite sure i've been making the mis-steps for years.

                for what it's worth - on my stata 17se on a 7 year old pc laptop: the single took less than 1 second to run the model that Carlo Lazzaro presented without i.firm effects, and about 10 minutes to run with i.firm effects. the results were identical, despite the effects from idcode 2/3 not in the model..

                regarding Jared Greathouse's advice of when to include a firm fixed effect "If you think there's no unobserved, unit-specific, time-stable confounding (spoiler: rarely is this the case)" - is there a way this can be determined from the data that does not involve running the models with and without that second-level effect, which is so computing-time-intensive?

                given the 2-3 magnitude difference in computing time, it would be very efficient to know when to (avoid needing to) include second-level fixed effects.
                i'm far from any expert and ask the question with deference.
                thanks!
                Last edited by George Hoffman; 11 Apr 2022, 19:38.

                Comment


                • #9
                  George:
                  probably the confusion stems form the fact that we can go -fe- with -regress- too, provided that -panelid- is plugged in as a categorical predictor in the right-hand side of the panel data regression equation:
                  Code:
                  use "https://www.stata-press.com/data/r17/nlswork.dta"
                  . xtreg ln_wage c.age##c.age i.year if idcode<=3, fe
                  
                  Fixed-effects (within) regression               Number of obs     =         39
                  Group variable: idcode                          Number of groups  =          3
                  
                  R-squared:                                      Obs per group:
                       Within  = 0.7404                                         min =         12
                       Between = 0.4068                                         avg =       13.0
                       Overall = 0.4014                                         max =         15
                  
                                                                  F(16,20)          =       3.57
                  corr(u_i, Xb) = -0.8560                         Prob > F          =     0.0042
                  
                  ------------------------------------------------------------------------------
                       ln_wage | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                  -------------+----------------------------------------------------------------
                           age |   .0773019   .2865219     0.27   0.790    -.5203723    .6749761
                               |
                   c.age#c.age |  -.0045583   .0012212    -3.73   0.001    -.0071057    -.002011
                               |
                          year |
                           69  |   .3367906   .4335876     0.78   0.446    -.5676572    1.241238
                           70  |   .2089384   .6771373     0.31   0.761    -1.203545    1.621422
                           71  |   .3144116   .9610926     0.33   0.747    -1.690392    2.319216
                           72  |   .5888124   1.253657     0.47   0.644     -2.02627    3.203894
                           73  |   .8912873   1.550825     0.57   0.572    -2.343676    4.126251
                           75  |   1.246958   2.152898     0.58   0.569    -3.243908    5.737823
                           77  |   1.560689   2.761762     0.57   0.578    -4.200247    7.321624
                           78  |   1.941522   3.068213     0.63   0.534    -4.458659    8.341703
                           80  |    2.34498   3.684737     0.64   0.532    -5.341247    10.03121
                           82  |   2.698954   4.315145     0.63   0.539     -6.30228    11.70019
                           83  |   2.994437   4.618087     0.65   0.524    -6.638723     12.6276
                           85  |   3.538578   5.245889     0.67   0.508    -7.404154    14.48131
                           87  |   3.965153   5.878139     0.67   0.508    -8.296429    16.22674
                           88  |    4.40786   6.407149     0.69   0.499    -8.957218    17.77294
                               |
                         _cons |   1.465543   5.342682     0.27   0.787    -9.679096    12.61018
                  -------------+----------------------------------------------------------------
                       sigma_u |  .54258328
                       sigma_e |  .21942548
                           rho |  .85944136   (fraction of variance due to u_i)
                  ------------------------------------------------------------------------------
                  F test that all u_i=0: F(2, 20) = 10.43                      Prob > F = 0.0008
                  
                  . reg ln_wage c.age##c.age i.year i.idcode if idcode<=3
                  
                        Source |       SS           df       MS      Number of obs   =        39
                  -------------+----------------------------------   F(18, 20)       =      4.86
                         Model |  4.21278813        18  .234043785   Prob > F        =    0.0005
                      Residual |  .962950828        20  .048147541   R-squared       =    0.8139
                  -------------+----------------------------------   Adj R-squared   =    0.6465
                         Total |  5.17573896        38  .136203657   Root MSE        =    .21943
                  
                  ------------------------------------------------------------------------------
                       ln_wage | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                  -------------+----------------------------------------------------------------
                           age |   .0773019   .2865219     0.27   0.790    -.5203723    .6749761
                               |
                   c.age#c.age |  -.0045583   .0012212    -3.73   0.001    -.0071057    -.002011
                               |
                          year |
                           69  |   .3367906   .4335876     0.78   0.446    -.5676572    1.241238
                           70  |   .2089384   .6771373     0.31   0.761    -1.203545    1.621422
                           71  |   .3144116   .9610926     0.33   0.747    -1.690392    2.319216
                           72  |   .5888124   1.253657     0.47   0.644     -2.02627    3.203894
                           73  |   .8912873   1.550825     0.57   0.572    -2.343676    4.126251
                           75  |   1.246958   2.152898     0.58   0.569    -3.243908    5.737823
                           77  |   1.560689   2.761762     0.57   0.578    -4.200247    7.321624
                           78  |   1.941522   3.068213     0.63   0.534    -4.458659    8.341703
                           80  |    2.34498   3.684737     0.64   0.532    -5.341247    10.03121
                           82  |   2.698954   4.315145     0.63   0.539     -6.30228    11.70019
                           83  |   2.994437   4.618087     0.65   0.524    -6.638723     12.6276
                           85  |   3.538578   5.245889     0.67   0.508    -7.404154    14.48131
                           87  |   3.965153   5.878139     0.67   0.508    -8.296429    16.22674
                           88  |    4.40786   6.407149     0.69   0.499    -8.957218    17.77294
                               |
                        idcode |
                            2  |  -.4183815   .0918256    -4.56   0.000    -.6099263   -.2268366
                            3  |   .6579353   1.834332     0.36   0.724    -3.168414    4.484284
                               |
                         _cons |   1.341224   4.651269     0.29   0.776    -8.361153     11.0436
                  ------------------------------------------------------------------------------
                  
                  .
                  As expected, the coefficinets of teh shared predictors are identical no matter the approach we follow.
                  That said, while what above is useful to show the way -fe- machinery works, I do prefer -xtreg- when it comes to panel data analysis.
                  Kind regards,
                  Carlo
                  (StataNow 18.5)

                  Comment


                  • #10
                    If \(T\) is large, you can install reghdfe from SSC and absorb both the firm and time indicators. A test of whether time effects should be included in the model involves comparing the the log-likelihood for the model absorbing only firm indicators with that of the model absorbing both time and firm indicators within which it is nested. Such a likelihood ratio test is equivalent to the Wald test of the joint significance of the time indicators. You need to do this test manually where the degrees of freedom in the test equal the number of absorbed year indicators.

                    You have that

                    $$LR= 2(\ell_{1}-\ell_{0})$$

                    and the test statistic is distributed as \(\chi^2(T-1)\) under the null hypothesis, where \(T\) is the number of time periods and \(\ell_{1}\) and \(\ell_{0}\) are the log-likelihoods from the model with both sets of indicators and model with firm dummies only, respectively. With large \(T\), the LR test and the Wald test of joint significance of the year dummies will be equivalent. Compare:

                    Code:
                    webuse nlswork, clear
                    xtset idcode year
                    xtreg ln_wage wks_work tenure i.year, fe
                    testparm i.year
                    reghdfe ln_wage wks_work tenure, absorb(idcode)
                    local ll0= e(ll)
                    reghdfe ln_wage wks_work tenure  i.year, absorb(idcode year)
                    local ll1= e(ll)
                    qui levelsof year if e(sample), local(years)
                    local Tminus1 = wordcount("`years'")-1
                    local LR= 2*(`ll1'-`ll0')
                    display " LR chi2(`Tminus1')  =  `:di %4.2f `LR''; Prob > chi2  `:di %4.3f chi2tail(`Tminus1',`LR')'"
                    Res.:

                    Code:
                    . testparm i.year
                    
                     ( 1)  69.year = 0
                     ( 2)  70.year = 0
                     ( 3)  71.year = 0
                     ( 4)  72.year = 0
                     ( 5)  73.year = 0
                     ( 6)  75.year = 0
                     ( 7)  77.year = 0
                     ( 8)  78.year = 0
                     ( 9)  80.year = 0
                     (10)  82.year = 0
                     (11)  83.year = 0
                     (12)  85.year = 0
                     (13)  87.year = 0
                     (14)  88.year = 0
                    
                           F( 14, 22718) =   49.53
                                Prob > F =    0.0000
                    
                    
                    .
                    . local LR= 2*(`ll1'-`ll0')
                    
                    .
                    . display " LR chi2(`Tminus1')  =  `:di %4.2f `LR''; Prob > chi2  `:di %4.3f chi2tail(`Tminus1',`LR')'"
                     LR chi2(14)  =  807.01; Prob > chi2  0.000

                    Having showed the above, with a large \(T\) dimension, you would almost always find that the time indicators are significant, so one need not bother doing the test.

                    Comment

                    Working...
                    X