In my regression model, I need to control for year and industry fixed effects.
However, I'm not familiar with using this in a regression and the information on the internet does not help me any further.
See the CODE below for an example what my dataset looks like. Var1 is my dependent variable and var2 is my independent variable, which is a dummy variable (only 0's in this example). The others are all control variables, of which some are dummies.
I read that the code for including year-fixed effects is xtreg, but how does this work? Do I simply type xtreg instead of regress to conduct the regression analysis? And is the only difference between the two the year-fixed effects? Or do I need another code?
Second, how does this work for industry fixed effects? I know that I need to have the SIC (industry) codes for the firms, but when I do, what code(s) do I need to type in order to get industry fixed effects, so that I will run the regression with both year- and industry-fixed effects?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int var1 byte var2 float(logSIZE_w MTB_w) int AGE_IPO_w float(spiDummy LOGoneplusNBSEG_w LOGoneplusNGSEG_w ROA_w) byte(MAdummy SEOdummy DummyDLW) 88 0 7.196187 1.166318 3 1 2.3025851 1.94591 .04446634 0 0 1 86 0 9.19575 2.8851354 4 1 .6931472 .6931472 .0017544986 0 0 1 78 0 7.566396 9.215198 1 0 1.3862944 2.3025851 .007851241 1 1 1 99 0 6.954309 2.624991 2 0 1.3862944 .6931472 .018489398 0 0 1 106 0 7.350137 .9179307 1 0 .6931472 .6931472 .0017931758 0 1 1 97 0 7.129186 .8941061 1 0 .6931472 .6931472 .004919433 0 1 1 78 0 7.409235 3.4222646 0 1 1.3862944 1.94591 .024645675 0 1 1 88 0 8.122998 4.624203 2 1 1.3862944 1.3862944 .015374686 0 1 1
0 Response to Year and industry fixed effects
Post a Comment