Dear stata users,
I want to run a regression with industry and year fixed effects. When I asked my supervisor, she told me to use the following command:
After the regression, I want to run a regression with fixed effects and robust standard errors, because I want to control for heteroskedasticity.
In order to do so, I found the following regression online:
However, this code gives me 2 problems.
1. when I try to run the xtreg code without the robust option, it gives me that "xx.sic2 omitted because of collinearity", but the results are different compared to the xi regression.
2. when I run it with the robust option, it returns me that "panels are not nested within clusters"
I was wondering why the sic2 dummies are getting removed and how to solve this. Same applies for the 2nd problem, I dont understand the error nor how to solve this.
I hope someone can explain and try to solve this problem so I can run a regression with fixed effects and with and without robust function.
I want to run a regression with industry and year fixed effects. When I asked my supervisor, she told me to use the following command:
Code:
xi: reg y x i.fyear i.sic2, cl(cusip8)
In order to do so, I found the following regression online:
Code:
xtset cusip8 xtreg y x i.fyear i.sic2, fe vce(robust)
1. when I try to run the xtreg code without the robust option, it gives me that "xx.sic2 omitted because of collinearity", but the results are different compared to the xi regression.
2. when I run it with the robust option, it returns me that "panels are not nested within clusters"
I was wondering why the sic2 dummies are getting removed and how to solve this. Same applies for the 2nd problem, I dont understand the error nor how to solve this.
I hope someone can explain and try to solve this problem so I can run a regression with fixed effects and with and without robust function.
Comment