Announcement

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

  • Firm fixed and time fixed effects

    Dear all,

    I have a panel dataset of 250 firms over the period 1996-2016. I want to include firm and year fixed effects. First I xtset my data and then I run a regression:

    Code:
    xtset Firm Year
    xtreg DepVar Var1 Var2 Var3 i.Year, fe
    The problem is that the outcome seems to be taking into account years after 1999

    Code:
            Year |
           1999  |    .004919   .0052325     0.94   0.348    -.0053906    .0152287
           2000  |  -.0031099   .0047207    -0.66   0.511    -.0124112    .0061914
           2001  |   -.005876   .0035708    -1.65   0.101    -.0129116    .0011597
           2002  |   -.003132   .0037677    -0.83   0.407    -.0105556    .0042917
           2003  |  -.0043326   .0038154    -1.14   0.257    -.0118501     .003185
           2004  |  -.0071511   .0038803    -1.84   0.067    -.0147966    .0004945
           2005  |  -.0094169   .0053565    -1.76   0.080    -.0199711    .0011373
           2006  |  -.0091469   .0058642    -1.56   0.120    -.0207013    .0024075
           2007  |  -.0077155   .0058272    -1.32   0.187    -.0191969    .0037659
           2008  |    -.00401   .0049859    -0.80   0.422    -.0138338    .0058138
           2009  |  -.0096346   .0051773    -1.86   0.064    -.0198357    .0005665
           2010  |  -.0097586   .0059415    -1.64   0.102    -.0214654    .0019482
           2011  |  -.0097764   .0058023    -1.68   0.093    -.0212088     .001656
           2012  |  -.0106399   .0061505    -1.73   0.085    -.0227584    .0014786
           2013  |  -.0097887   .0061963    -1.58   0.116    -.0219975    .0024201
           2014  |  -.0088853   .0062729    -1.42   0.158    -.0212449    .0034744
           2015  |  -.0061224   .0061494    -1.00   0.320    -.0182389     .005994
           2016  |  -.0092903   .0066645    -1.39   0.165    -.0224216     .003841
    Note that Var1-Var2 include lagged variables. Is this the reason it happens?

    Kind regards,
    Angelos Nicolaou




  • #2
    Yes. Those lagged variables will be missing for 1996-1998 and hence those observations are omitted from the regression.

    Comment


    • #3
      Thanks for your quick answer Jesse.

      But the code I use to include fixed and time effects is correct, right?

      Code:
      xtset Firm Year
      xtreg DepVar Var1 Var2 Var3 i.Year, fe

      Comment


      • #4
        Yes. Depending on how large your dataset is, it might help to use reghdfe (from SSC) instead of xtreg, which is a lot faster when including multiple fixed effects. The syntax would be
        Code:
        reghdfe Depvar Var1 Var2 Var3, absorb(Firm Year)
        . And of course if you use lags of your dependent variable, know that standard fixed effects regressions won't be reliable.

        Comment

        Working...
        X