Hi guys,
I'm fairly new to Stata and have a question regarding fixed effects. I tried finding the answer by reading other questions but I'm a bit confused as I have seen various different answers.
For my thesis I want to run a baseline OLS regression for panel data. If I am not mistaken, this would be done by
reg y x1 x2
Now, I want to keep both industry and year fixed effects into account. Online I have seen various answers. Now I am confused when to use the ,fe option for xtreg and when to use the i.year or i.industry options.
I first set my data to panel by using
xtset gvkey year
And now want to run a regression where industry (identified by SIC code) fixed effects and year fixed effects are taken into account. What should the code be for this?
When I try the following codes
xtreg y x1 x2 i.year, fe
xtreg y x1 x2 i.year i.sic
I get very different answers.
Thanks in advance!
I'm fairly new to Stata and have a question regarding fixed effects. I tried finding the answer by reading other questions but I'm a bit confused as I have seen various different answers.
For my thesis I want to run a baseline OLS regression for panel data. If I am not mistaken, this would be done by
reg y x1 x2
Now, I want to keep both industry and year fixed effects into account. Online I have seen various answers. Now I am confused when to use the ,fe option for xtreg and when to use the i.year or i.industry options.
I first set my data to panel by using
xtset gvkey year
And now want to run a regression where industry (identified by SIC code) fixed effects and year fixed effects are taken into account. What should the code be for this?
When I try the following codes
xtreg y x1 x2 i.year, fe
xtreg y x1 x2 i.year i.sic
I get very different answers.
Thanks in advance!
Comment