I want to run a fixed effect model controlling for year and industry effects. I have read through some references on how to go about it, but yet not really sure if the procedures I am following are right
First, I would need to xtset my panel data with industry grouping. But I am not sure if I group data using Ticker/firrm id is okay too
The next I am confused which following to run as some references says to add Stata features xi: before running fixed effect model on panel data
Methord 1
Methord 2
Lastly, run command to see if time fixed effects are needed
Below is my data in panel structure
First, I would need to xtset my panel data with industry grouping. But I am not sure if I group data using Ticker/firrm id is okay too
Code:
egen id = group(Industry) xtset id Year, y
Methord 1
Code:
xtreg DACC ROA Size MTB LEV LOSS i.Year, fe
Code:
xi: xtreg DACC ROA Size MTB LEV LOSS i.Year, fe
Code:
testparm i.year
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str9 Ticker int Year str23 Industry byte SICCode float(ROA Size MTB LEV LOSS DACC) "TH:SPSU" 2007 "Industrials" 11 .014094287 14.58573 .4777623 -.04100476 0 -.13350403 "TH:GC" 2012 "Industrials" 11 .06899457 13.93367 .8494591 0 0 .030991036 "TH:TPCH" 2012 "Resources" 33 -.0020756533 11.93638 . .0002619121 1 . "TH:EE" 2014 "Agro & Food Industry" 22 .00018812453 14.25858 2.487009 .0023916855 0 .05917667 "TH:TTL" 2014 "Consumer Products" 66 -.2715816 14.133175 1.5325614 .00266392 1 -.1782501 "TH:EE" 2011 "Agro & Food Industry" 22 -.006340273 14.210468 1.240886 .0038401396 1 .015338974 "TH:EE" 2013 "Agro & Food Industry" 22 .007601305 14.259856 1.34223 .003901328 0 .017898992 "TH:CSR" 2000 "Services" 55 .008508377 14.677366 .12823841 .004070032 0 .1108473 "TH:CSR" 2001 "Services" 55 .012657777 14.68637 .17238885 .004446275 0 .04925008 "TH:CSR" 2002 "Services" 55 .017517675 14.697324 .2813456 .0044545652 0 .0520633 "TH:CSR" 2003 "Services" 55 .016676517 14.698357 .3215286 .0045120073 0 .04526159 "TH:EE" 2012 "Agro & Food Industry" 22 .04046876 14.252687 2.1824718 .004553293 0 .066115335 "TH:CSR" 1998 "Services" 55 .010474646 14.285906 .2188438 .005102376 0 .05515802 "TH:CSR" 1999 "Services" 55 .010221212 14.29216 .2686679 .005165552 0 .0815233 "TH:CSR" 2008 "Services" 55 .029514614 14.471094 .4226215 .005320657 0 -.02775518 "TH:CSR" 2004 "Services" 55 .019360255 14.700903 .3890025 .005347091 0 .04013493 "TH:EE" 2010 "Agro & Food Industry" 22 -.0299568 14.219323 2.4644845 .005696073 1 .02374406 "TH:CSR" 1995 "Services" 55 .010037953 14.220117 .28630632 .006270718 0 .02764596 "TH:CSR" 2005 "Services" 55 .02462999 14.70609 .3725338 .006273235 0 .04560977 "TH:CSR" 1997 "Services" 55 .00933447 14.296027 .3062665 .00647284 0 .1511482 "TH:EE" 2009 "Agro & Food Industry" 22 -.07361579 14.250206 2.899881 .006887054 1 -.05890745 "TH:CSR" 2006 "Services" 55 .02740221 14.673937 .437736 .007565762 0 .04198445 "TH:CSR" 2007 "Services" 55 .03638902 14.472492 .4850081 .008483323 0 .01137247 "TH:CSR" 2010 "Services" 55 .03227611 14.42795 .5435546 .008543436 0 .03366521 "TH:GREEN" 2010 "Resources" 33 -.08444518 13.22606 .3865738 .008890579 1 -.067248516 "TH:CSR" 2009 "Services" 55 .03392785 14.416633 .58970714 .009038656 0 .04010501 "TH:CSR" 2011 "Services" 55 .022481415 14.432555 .4915923 .010028908 0 .02457018 "TH:CSR" 2012 "Services" 55 .036740415 14.37295 .5702619 .011839443 0 .008430988 "TH:FANCY" 2008 "Consumer Products" 66 -.002275843 14.20212 .4007641 .012065365 1 -.029234566 "TH:FANCY" 2012 "Consumer Products" 66 -.05364843 14.061686 .6559972 .014183925 1 -.05211401 "TH:BSBM" 2014 "Industrials" 11 .005101281 14.44726 .7634732 .014200117 0 .02556101 "TH:FANCY" 2011 "Consumer Products" 66 -.024740083 14.11579 .667412 .014276002 1 .017903345 "TH:GREEN" 2007 "Resources" 33 .014111684 13.316074 .9278563 .01436874 0 .071650654 "TH:CSR" 1996 "Services" 55 -.007614495 14.32066 .23859185 .014927885 1 .03803191 "TH:NUSA" 2009 "Property & Construction" 77 -.063287064 12.200255 1.3596687 .014996982 1 .51596266 "TH:ESTAR" 2004 "Property & Construction" 77 .023478456 15.229934 .59103405 .016378747 0 .2145841 "TH:THL" 1997 "Resources" 33 -.026333883 13.660789 .24226014 .017023228 1 .07399729 "TH:FANCY" 2010 "Consumer Products" 66 .03932139 14.175484 .6812707 .018084953 0 -.08507758 "TH:CITY" 2009 "Industrials" 11 .09795809 13.618333 .55446744 .018106194 0 -.08706427 "TH:GREEN" 2008 "Resources" 33 .010875948 13.31223 .3286618 .018575953 0 -.10521555 "TH:GREEN" 2011 "Resources" 33 -.1208288 13.110133 .3045941 .019580014 1 .02429825 "TH:MAX" 2014 "Agro & Food Industry" 22 -.012943343 13.77311 13.087386 .01972279 1 -.10308635 "TH:GREEN" 2009 "Resources" 33 .002910374 13.319901 .385308 .020149376 0 -.02801403 "TH:THL" 1996 "Resources" 33 .0031028066 13.689335 .45175385 .020599913 0 .04710346 "TH:FANCY" 2014 "Consumer Products" 66 .015741581 14.06943 .752555 .021333985 0 .06809422 "TH:CITY" 2013 "Industrials" 11 .1124619 13.92324 .8257934 .021445643 0 -.006409266 "TH:BROCK" 2011 "Property & Construction" 77 .010353744 14.031117 .692175 .021804526 0 -.01194092 "TH:BROCK" 2012 "Property & Construction" 77 .02430121 14.04804 1.0046791 .021842003 0 -.04838569 "TH:TSTE" 2005 "Services" 55 .04087449 13.88498 .4739544 .022144897 0 .023569893 "TH:BROCK" 2010 "Property & Construction" 77 .011040293 14.03121 .7512964 .023772333 0 -.06749149 "TH:MANRIN" 2010 "Services" 55 .09554751 13.346224 .4891901 .02389487 0 .05745332 "TH:ESTAR" 2008 "Property & Construction" 77 .02516061 15.26544 .3088253 .024305776 0 -.1190804 "TH:CITY" 2010 "Industrials" 11 .07490723 13.666142 .7111215 .025234194 0 .06643253 "TH:TH" 2012 "Services" 55 .02724144 12.925256 4.993073 .025324503 0 .08167597 "TH:SST" 1998 "Agro & Food Industry" 22 .01872324 12.972658 .4327315 .02566896 0 -.0011186806 "TH:TH" 2005 "Services" 55 .02668001 11.897432 .9901683 .026434926 0 -.003942776 "TH:PRIME" 2007 "Resources" 33 -.25100282 12.80208 2.3704576 .02659985 1 -.1731891 "TH:BROCK" 2014 "Property & Construction" 77 .009595572 14.050385 1.8651003 .026659023 0 -.05020552 "TH:BROCK" 2009 "Property & Construction" 77 .014665804 14.035526 .5113254 .02693292 0 .09961533 "TH:SUPER" 2013 "Resources" 33 .0835338 13.519955 3.961224 .027229553 0 .3377129 "TH:ESTAR" 2009 "Property & Construction" 77 .005035982 15.273445 .381608 .02761785 0 .009397772 "TH:BROCK" 2013 "Property & Construction" 77 -.012355656 14.042366 1.1352468 .028494047 1 -.02570643 "TH:FANCY" 2013 "Consumer Products" 66 .020482384 14.09883 .6306444 .02878652 0 .06619368 "TH:FANCY" 2009 "Consumer Products" 66 .05592462 14.225496 .7258965 .02887053 0 -.007587069 "TH:AI" 2004 "Resources" 33 .18728033 14.297224 4.2949805 .02918375 0 -.10123187 "TH:TSTE" 2004 "Services" 55 .05979726 13.869002 .7465113 .029244095 0 .03331303 "TH:UPOIC" 2002 "Agro & Food Industry" 22 .06390125 13.508128 1.7738768 .031169387 0 .0021835372 "TH:MANRIN" 2002 "Services" 55 .06497018 13.248763 .840821 .031558 0 .02312358 "TH:CFRESH" 2009 "Agro & Food Industry" 22 .12792502 14.174372 1.1547698 .031629577 0 -.07600099 "TH:TH" 2007 "Services" 55 -.0018997847 11.890032 .6124228 .03241979 1 .07279292 "TH:MANRIN" 2007 "Services" 55 .025828796 13.326117 .8162632 .032711364 0 .025271904 "TH:FANCY" 2007 "Consumer Products" 66 .02627013 14.226185 .6320099 .03333391 0 -.0577042 "TH:THL" 1995 "Resources" 33 .013611668 13.73223 .6076633 .03417372 0 .000791589 "TH:TH" 2009 "Services" 55 -.002619219 11.8903 .6817165 .03444753 1 .06828755 "TH:TH" 2008 "Services" 55 .003706535 11.894767 .6790115 .034921978 0 .12491308 "TH:MANRIN" 2011 "Services" 55 -.03799874 13.28389 .47471395 .035524487 1 .032001007 "TH:BROCK" 2008 "Property & Construction" 77 .06539111 14.066417 .3550506 .035737906 0 -.14796616 "TH:BROCK" 2006 "Property & Construction" 77 .03812097 13.986418 .9880153 .035969894 0 -.4165837 "TH:ACC" 2013 "Resources" 33 .063474126 13.53639 1.285913 .03597594 0 -.17010236 "TH:MANRIN" 2001 "Services" 55 .09485351 13.266666 .7510354 .036446296 0 .10605314 "TH:TTL" 2013 "Consumer Products" 66 .04614244 14.424273 .773465 .03727758 0 -.13896605 "TH:SST" 2003 "Agro & Food Industry" 22 .06153486 13.217994 .8110731 .03738622 0 .14343196 "TH:TSTE" 1997 "Services" 55 .14295185 12.848227 . .03742298 0 .13269389 "TH:TH" 2010 "Services" 55 .00008161378 11.89842 .8241841 .03748113 0 -.09472122 "TH:MANRIN" 2004 "Services" 55 .04591553 13.30616 .6469458 .03791901 0 .0043247337 "TH:RWI" 2010 "Industrials" 11 .03927566 13.23513 . .03825545 0 -.1099177 "TH:ACC" 2014 "Resources" 33 .011469268 13.51036 1.1477786 .03838602 0 . "TH:SST" 2002 "Agro & Food Industry" 22 .05623237 13.19954 .652477 .03862874 0 .05832521 "TH:CITY" 2006 "Industrials" 11 .18833555 13.42103 1.0002177 .03882907 0 .01367529 "TH:UPOIC" 2001 "Agro & Food Industry" 22 .1261874 13.623796 1.7563664 .03899378 0 -.07932497 "TH:CITY" 2011 "Industrials" 11 .0856399 13.752286 .6785945 .03927528 0 -.068395935 "TH:GREEN" 2006 "Resources" 33 .12532954 13.40116 1.2430297 .03951602 0 .12175868 "TH:CITY" 2012 "Industrials" 11 .13172463 13.86745 .9200115 .04030529 0 -.10071439 "TH:MANRIN" 2005 "Services" 55 .07761973 13.354243 .6799977 .04041657 0 .04470363 "TH:MANRIN" 2003 "Services" 55 .0770766 13.302565 .7287181 .04195387 0 .0433143 "TH:TR" 2009 "Consumer Products" 66 .028913254 16.588186 .4736879 .04249008 0 -.022260224 "TH:TR" 2001 "Consumer Products" 66 .10832603 15.53708 .4141641 .04271182 0 .0465218 "TH:GREEN" 2014 "Resources" 33 -.27074698 12.623858 9.593626 .04274346 1 -.17125164 "TH:CITY" 2014 "Industrials" 11 .11920575 14.035776 .9363398 .04375213 0 -.10432828 "TH:TSTE" 1998 "Services" 55 .06311437 12.78541 .6154369 .04412123 0 .08939533 end format %ty Year
Comment