Announcement

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

  • Results are generating omitted dummy variables for fixed effect panel regressions

    I have the following fixed effect regression where i wanted to control for ID and year fixed effects. So I did the following regressions but the results omitted all year dummies without any exception. Does this mean when I write fe this would control automatically for the variables that I identified in xtset? in other words by putting xtset ID year and putting fe command , did I run the dummies twice in my model?
    Code:
    xtset ID year
    
    gen d2002 if year=2002
    gen d2003 if year=2003
    gen d2004 if year=2004
    gen d2005 if year=2005
    gen d2006 if year=2006
    gen d2007 if year=2007
    gen d2008 if year=2008
    gen d2009 if year=2009
    gen d2010 if year=2010
    gen d2011 if year=2011
    gen d2012 if year=2012
    gen d2013 if year=2013
    gen d2014 if year=2014
    gen d2015 if year=2015
    gen d2016 if year=2016
    gen d2017 if year=2017
    gen d2018 if year=2018
    gen d2019 if year=2019
    
    xtreg rec_days L.EPU L.GrossMargin L.AssetTurnover L.FreeCollateral L.CashRatio L.ShortBorrowing L.RSI d2003 d2004 d2005 d2006 d2007 d2008 d2009 d2010 d2011 d2012 d2013 d2014 d2015 d2016 d2017 d2018 d2019,fe robust

  • #2
    xtreg, fe takes care of fixed effects for the panel identifier but not for the time identifier, so you still have to include year fixed effects in the regression.

    I think the problem is that the way you create dummy variables is not the right way. I'm suprised you don't even get an error with that syntax.

    The right way would be:
    Code:
    gen d2002 = year == 2002
    Or
    Code:
    tab year, gen(d)
    In any case, you don't need to create dummy variables in the first place as Stata's factor variable notation is much more convenient. Simply include i.year in the regression and Stata handles it for you.
    Last edited by Wouter Wakker; 26 Oct 2020, 04:07.

    Comment

    Working...
    X