Solved – Industry and Year Fixed Effects

fixed-effects-modelpanel datarandom-effects-modelstata

I hope someone can help me as I am stuck with this problem for quite some time.

I have panel of S&P500 companies from 2010 – 2014 and I want to run a regression including industry and year fixed effects.

I am a beginner in panel data analysis and also Stata, and I cant find the answer anywhere. I am so confused as I am not sure whether industry and year fixed effects are equivalent to cross-section and period fixed effects.

Best Answer

Let's say you have some category variable $c_i$ (eg. c may be the industry company $i$ is in). An important mathematical point to keep in mind is that running a fixed effects regression with fixed effects for $c$ is equivalent to running a regular regression with indicator variables for each possible value of $c$.

A basic strategy might be to:

  1. use xtset industryvar in Stata to indicate you want fixed effects for each unique value of industryvar.
  2. Generate dummy variables for every year.
  3. Call xtreg with the fe option to indicate fixed effects, including the dummy variables for year as right hand side variables.

More explicitly, you might do something like:

xtset industry
xtreg y x1 x2 i.year, fe

This assumes year is a variable which holds the year, industry is a variable that holds the industry etc...

Related Question