I'm investigating the influence of patenting (pat_yr -> patents per year) on the returnoninvestement of firms and look at whether there is a difference between it in normal and in M&A firms (dummy variable labeled 1 if active in M&A starting from the first year a firm engaged in a MA and in the year after that, and 0 in the years before M&A or in all years if never MA). I want to control for firm size, using variables totalemp (employees, absolute number) and totalassets (absolute number), industry (sic2d) and year (fyear). I ran a regression analysis using the following code:

Code:
 xtreg returnoninvestment pat_yr maactive totalemp totalassets totalma i.sic2d i.fyear
In the results I see the industry (sic2d) and year (fyear) just summed up, resulting in none of the variables being significant and in a really low R-squared. So, my question is; did I used the control variables fyear and sic2d in the right way or should I make dummy variables (or is there an other way to do it)?

thanks in advance


Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double fyear float returnoninvestment double pat_yr float(maactive totalemp totalassets sic2d)
2011    6.62207     1 1  42000   2.504e+09  1
2012   8.460791     1 1  44000  2.5334e+09  1
2010   5.947549     1 1  42000  2.5177e+09  1
2015   7.905769     0 1  47000  2.5961e+09  1
2013   5.750575     0 1  46000  2.5892e+09  1
2014   9.232193     0 1  45000  2.6753e+09  1
2014  4.5476975    10 1   3330  3.6011e+10 13
2015  -8.611002    44 1  15900  9.7484e+10 13
2003  10.689542 206.5 1 101000  1.5463e+10 13
1999   4.863281   169 1  55000 15081192448 13
2014   5.595635     3 1    879   617257024 13
1998    6.17271    13 0  24344  1.4544e+10 13
2006   8.806937     7 1   1015   655136000 13
2009   8.239728    45 1  30000 1.52588e+11 13
2000  10.725432     0 0   3606  1259491968 13
2003 -3.8821976     1 0   6523  4318978048 13
1999   7.917287     3 0   1732   190575008 13
2015 -10.201712     3 1   2611  3.2311e+10 13
2013  12.460523     6 1   1072   864670976 13
2010   21.10337   291 1  58000  1.8297e+10 13
2011   26.26414   246 1  68000  2.3677e+10 13
2013   11.22636     3 0   5500  8391434240 13
2009  14.747487     1 1  10100  4.4229e+10 13
2010   14.54428  48.5 1  29700 1.56314e+11 13
2011  13.210893     3 1    937   674057984 13
2004   4.004003     0 1   4251  1406844032 13
2003  11.209698     1 1   4800   662856000 13
1998    8.56471     1 0   1425   311008000 13
2007   31.22284     1 1   9700  3.6519e+10 13
2015  11.055277   536 1  95000  6.8005e+10 13
2005  13.246954     2 1   5500   989568000 13
2009  -6.838685     0 1   1980   649043008 13
2000   7.195266   226 1  60000 17172730880 13
2002  -20.50087     6 1    598   248444992 13
2001  14.096665     4 1   3500   579611008 13
2004  10.218787   230 1  97000  1.5796e+10 13
2006   33.72608 298.5 1 104000   1.682e+10 13
2008   31.39067     0 1   8176  7370458112 13
2014 -1.8685552     3 1  11700  5.6259e+10 13
2012   44.57113     0 1   3600  1367163008 13
2012  16.949535 539.5 1 118000  6.1547e+10 13
2015 -8.7120285     0 1   3114 10929901568 13
2009    21.7296     2 1   7900  1880286976 13
2004   6.686217     0 0   6982  4195610880 13
2008    24.7719     9 1  30360  4.2686e+10 13
1997  16.879433     1 0   2600   316543008 13
2006   27.39014     0 1   7253  5663331840 13
2008   38.72713     1 1  10400  4.1537e+10 13
2002   9.571697   223 1  78500 19435194368 13
2013  26.837883     3 1  12200  3.1285e+09 13
2012  15.846274     4 1  12300   6.421e+10 13
2014  31.886387     0 1   4500  1759357952 13
2006  32.701637   227 1  70000 22832138240 13
1998  15.215705  85.5 1  64000 16077929472 13
1998   21.11728   136 1 107800 1.10659e+10 13
2011   50.30707     0 1   3400  1338210944 13
2009  31.414486     0 1   8012  7725401088 13
1999   8.551674   180 1 103000  1.0728e+10 13
1999  13.400212    72 0  15900  1.5201e+10 13
2000   6.420737 204.5 1  93000  1.0103e+10 13
2004   7.256504     1 1   1528   508988000 13
2007   3.723837     0 1   2895  1295536000 13
1999   7.088449     1 0   3440  1109698944 13
2014  26.097557     8 1  12400  3511700992 13
2011  24.319973     1 1  11300  6.0044e+10 13
2008   32.83079   262 1  87000 31990724608 13
2010  11.446418     0 1   8630 12070609920 13
2010  12.261573   576 1 108000  5.1767e+10 13
2000   22.98986    24 1   8791  1.9414e+10 13
2006   21.84428     2 1   2536  1086189952 13
2013   19.30848   409 1  77000  2.9223e+10 13
2003  10.518517     0 1   1529   226750000 13
2004  15.558134   229 1  52500 16000777216 13
2006  26.321285     1 1   5705  2134712064 13
2014   3.540117     0 1   3834 11759529984 13
2002   9.055222     7 1  28166  1.7812e+10 13
2004  24.950006     0 1   1596   262942000 13
2012   22.44598   4.5 1  10900  2768118016 13
2011  14.070517     0 1   9157 1.25257e+10 13
2009  16.509022 228.5 1  51000  1.6538e+10 13
2003  11.354794   224 1  77000 20041326592 13
2010  -7.179087     1 1   2932  1299628032 13
2003  3.4260876     0 1   3937  1415835008 13
2012   21.63513   299 1  73000   2.741e+10 13
1997   21.70649    71 1  70750   5.603e+09 13
2014  20.378656 474.5 1  80000   3.224e+10 13
2010   35.61142     0 1   2500   887870976 13
2004  -.3866473     9 1    743   479116000 13
1997  21.230953  87.5 0  63500 12096731136 13
2015   7.686701 516.5 1  65000  3.6942e+10 13
2010  22.636786     5 1   8200  2030505984 13
2013   20.72932     0 1  10333  6264826880 13
2013  16.137623     3 1  12900  6.9443e+10 13
2000   5.740849     2 0   3000   512684000 13
2012   14.34473     2 1   1071   820582976 13
1998   3.654596    74 0  17300  1.4216e+10 13
2011  21.456177     2 0   5300  6964156928 13
2005   5.762093    10 1    804   537860992 13
2002   7.382596     0 1   1391   308816992 13
1999   9.978066     7 0   3200   450976000 13
end