Solved – Using year fixed effects on data with yearly observations

categorical dataeconometricsfixed-effects-modelpanel data

I have a panel data set with yearly observations of various firms over a period of 5 years. I am running a fixed effects model in Stata using xtreg. Is it problematic to include a dummy variable for individual years, since I have yearly observations? (I would exclude a reference dummy.)

Here is the Stata code I would be using:

xtreg y x i.year, fe

Best Answer

It's not problematic and is even a good idea. The year dummies will pick up any variation in the outcome that happen over time and that is not attributed to your other explanatory variables. The other thing with fixed effects estimation in Stata is that many people are deceived by the xtset command where you can set a panel and a time variable. Only the panel variable is used to eliminate the individual (or in this case firm) fixed effects but it does nothing about the time fixed effects. So xtreg will perform the within transformation using the specified panel id but if you want to control for year fixed effects you need to include the dummies as you suggest.