Dear reader,
I am currently doing research on the relationship between ESG scores and firm financial performance. I have uploaded my data from Excel to Stata. Also, I want to check whether legal legislation affects this relationship, so I added a legal system variable. My Stata dataset looks like the following, but I am unsure whether I could run regressions to test multiple relationships with and without the control variables (Industry, other firm financials). So my question is whether I should let stata know this is a panel dataset and to replace string variables, or to type several other commands before running the regressions? I have data on 10 different countries for 20 years and a total of 128380 observations on 6419 firms. Thanks in advance!
I am currently doing research on the relationship between ESG scores and firm financial performance. I have uploaded my data from Excel to Stata. Also, I want to check whether legal legislation affects this relationship, so I added a legal system variable. My Stata dataset looks like the following, but I am unsure whether I could run regressions to test multiple relationships with and without the control variables (Industry, other firm financials). So my question is whether I should let stata know this is a panel dataset and to replace string variables, or to type several other commands before running the regressions? I have data on 10 different countries for 20 years and a total of 128380 observations on 6419 firms. Thanks in advance!
Code:
* Example generated by -dataex-. For more info, type help dataex clear input int(CompID year) str26 Country str22 Industry double(ROA TotalDebt TotalEquity DebtEquity Assets ESG Env Soc Gov NetSales TotalLiabilities MarketCap) long(Country_H Industry_n) float TQ str6 Legal_system 1 2003 "Japan" "Industrials" 5.759959689 4551529000 43909449000 10.3657165 68685818000 . . . . 79678232000 24776368000 77438855712 29 7 1.1274359 "civil" 1 2004 "Japan" "Industrials" 7.493196053 4069049000 47584081000 8.551282098 74467116000 . . . . 88721121000 26883035000 88411689960 29 7 1.1872581 "civil" 1 2005 "Japan" "Industrials" 7.819028068 3439735000 53791837000 6.394529713 80483498000 . . . . 94333718000 26691659000 113083094352 29 7 1.405047 "civil" 1 2006 "Japan" "Industrials" 7.395024391 3508245000 59779127000 5.868678878 87640437000 . . . . 96486007000 27861310000 116577627552 29 7 1.3301808 "civil" 1 2007 "Japan" "Industrials" 7.38060164 416885000 64088994000 .650478302 90333699000 . . . . 100737605000 26244703000 73804541184 29 7 .8170211 "civil" 1 2008 "Japan" "Industrials" 6.134401955 3.990e+08 6.6134e+10 .603320531 8.807e+10 . . . . 9.5984e+10 2.1937e+10 69680992008 29 7 .7912001 "civil" 1 2009 "Japan" "Industrials" 4.197361857 1.607e+09 6.490e+10 2.476117103 8.4324e+10 . . . . 8.7609e+10 1.9424e+10 65976786816 29 7 .78242 "civil" 1 2010 "Japan" "Industrials" 5.217411313 1.794e+09 6.8234e+10 2.629187795 8.9517e+10 . . . . 8.0984e+10 2.1281e+10 66745584120 29 7 .7456191 "civil" 1 2011 "Japan" "Industrials" 5.999522124 1.038e+09 7.1476e+10 1.452235716 9.4631e+10 . . . . 8.9216e+10 2.3156e+10 70361881224 29 7 .7435395 "civil" 1 2012 "Japan" "Industrials" 6.176250329 7.470e+08 7.5406e+10 .99063735 1.02997e+11 . . . . 9.5071e+10 2.7591e+10 94086204288 29 7 .9134849 "civil" 1 2013 "Japan" "Industrials" 7.018506689 1.280e+09 8.1898e+10 1.562919729 1.19301e+11 . . . . 1.01353e+11 3.7403e+10 140520990456 29 7 1.1778693 "civil" 1 2014 "Japan" "Industrials" 7.007203928 2.745e+09 9.1304e+10 3.0064400245 1.31812e+11 . . . . 1.41096e+11 4.0508e+10 169044250664 29 7 1.282465 "civil" 1 2015 "Japan" "Industrials" 7.84423428 3.944e+09 1.0325e+11 3.819854722 1.47017e+11 . . . . 1.43843e+11 4.3767e+10 161609277624 29 7 1.0992557 "civil" 1 2016 "Japan" "Industrials" 7.23645453 2.623e+09 1.08032e+11 2.427984301 1.53434e+11 . . . . 1.50061e+11 4.5402e+10 208517198440 29 7 1.3590026 "civil" 1 2017 "Japan" "Industrials" 7.614095099 2.473e+09 1.14936e+11 2.151632213 1.64634e+11 . . . . 1.51633e+11 4.9698e+10 282866928840 29 7 1.7181562 "civil" 1 2018 "Japan" "Industrials" 7.495060125 6.428e+09 1.22783e+11 5.2352524372 1.89626e+11 . . . . 1.63726e+11 6.6843e+10 248733643520 29 7 1.3117064 "civil" 1 2019 "Japan" "Industrials" 7.593832671 5.851e+09 1.26494e+11 4.6255158347 1.91025e+11 . . . . 1.91363e+11 6.4531e+10 245016157000 29 7 1.2826393 "civil" 1 2020 "Japan" "Industrials" 7.1291991224 8.153e+09 1.30226e+11 6.2606545544 2.06439e+11 . . . . 1.91501e+11 7.6213e+10 240960717160 29 7 1.1672248 "civil" 1 2021 "Japan" "Industrials" 5.7940754274 8.634e+09 1.34808e+11 6.4046644116 2.07363e+11 . . . . 1.74628e+11 7.2555e+10 224738957800 29 7 1.0837948 "civil" 1 2022 "Japan" "Industrials" 6.4276796702 2.0389e+10 1.45245e+11 14.0376605047 2.40388e+11 . . . . 2.14514e+11 9.5143e+10 211558778320 29 7 .8800721 "civil" 2 2003 "Japan" "Industrials" -2.952382189 7903771000 10888780000 72.586377905 36569454000 . . . . 34108522000 25680674000 12635987364 29 7 .3455339 "civil" 2 2004 "Japan" "Industrials" 3.320808627 7090811000 13547342000 52.340975816 37619645000 . . . . 34863751000 24072306000 14601585398.4 29 7 .38813725 "civil" 2 2005 "Japan" "Industrials" 5.232540426 6927351000 15287990000 45.312372653 36163139000 . . . . 35071111000 20875149000 22604377395.6 29 7 .6250668 "civil" 2 2006 "Japan" "Industrials" .071799936 6753991000 16906352000 39.949428475 38157261000 . . . . 33395758000 21250912000 15022784977.2 29 7 .3937071 "civil" 2 2007 "Japan" "Industrials" 1.914481736 6460431000 16801314000 38.451938938 37807214000 . . . . 33681734000 21005901000 14180385819.6 29 7 .3750709 "civil" 2 2008 "Japan" "Industrials" .401915138 7.667e+09 14885827000 51.50536816 36306939000 . . . . 34979473000 21421113000 11044788955.2 29 7 .304206 "civil" 2 2009 "Japan" "Industrials" 1.190689648 7601057000 14033988000 54.161774971 35392349000 . . . . 37815299000 21358363000 12542387457.6 29 7 .3543813 "civil" 2 2010 "Japan" "Industrials" 2.568508575 6593068000 14895439000 44.262327549 34436501000 . . . . 36158447000 19541062000 10436389563.6 29 7 .3030618 "civil" 2 2011 "Japan" "Industrials" 3.394446159 6817390000 15248624000 44.708230723 35569971000 . . . . 36882373000 20321348000 12823187176.8 29 7 .360506 "civil" 2 2012 "Japan" "Industrials" 4.050289666 7117225000 16512625000 43.101717625 39448861000 . . . . 40974170000 22936237000 13525186474.8 29 7 .3428537 "civil" 2 2013 "Japan" "Industrials" 4.291112704 8977529000 19757308000 45.439029447 43787685000 . . . . 44566154000 24030377000 15368584631.4 29 7 .3509796 "civil" 2 2014 "Japan" "Industrials" 3.662217668 8797873000 19741297000 44.565830705 43597454000 . . . . 43154005000 23856157000 16602183397.8 29 7 .3808063 "civil" 2 2015 "Japan" "Industrials" 2.576727152 7.417e+09 2.143e+10 34.610359309 4.3645e+10 . . . . 4.1581e+10 2.2215e+10 16807783192.2 29 7 .38510215 "civil" 2 2016 "Japan" "Industrials" 3.173012692 8.512e+09 2.1717e+10 39.195100612 4.6175e+10 . . . . 4.1782e+10 2.4458e+10 19043680956.3 29 7 .4124241 "civil" 2 2017 "Japan" "Industrials" 4.772068427 7.182e+09 2.4094e+10 29.808251017 4.7998e+10 . . . . 4.477e+10 2.3904e+10 22950077049.9 29 7 .4781465 "civil" 2 2018 "Japan" "Industrials" 5.642019419 7.122e+09 2.7301e+10 26.086956522 5.108e+10 . . . . 4.7275e+10 2.3779e+10 19840380159.6 29 7 .3884178 "civil" 2 2019 "Japan" "Industrials" 5.442373175 7.137e+09 2.9243e+10 24.405840714 5.2882e+10 . . . . 4.6722e+10 2.3639e+10 22718777281.2 29 7 .4296127 "civil" 2 2020 "Japan" "Industrials" 4.472254928 6.037e+09 3.0318e+10 19.912263342 5.2434e+10 . . . . 4.8118e+10 2.2116e+10 22847277152.7 29 7 .435734 "civil" 2 2021 "Japan" "Industrials" 5.4525049954 6.086e+09 3.4357e+10 17.7140029688 5.7167e+10 . . . . 4.6225e+10 2.281e+10 27653172346.8 29 7 .4837261 "civil" 2 2022 "Japan" "Industrials" 5.0989999452 1.216e+09 3.5228e+10 3.4517997048 5.2227e+10 . . . . 4.6483e+10 1.6999e+10 2.05857e+10 29 7 .3941582 "civil" 3 2003 "Japan" "Industrials" -9.662752298 8.5174e+09 15188728000 56.077111921 37136911000 . . . . 33935840000 21948183000 30271688250 29 7 .8151375 "civil" 3 2004 "Japan" "Industrials" 6.689576826 1.430e+09 22616504000 6.322816294 39364520000 . . . . 39179013000 16748014000 35277243000 29 7 .8961685 "civil" 3 2005 "Japan" "Industrials" 11.338016985 0 26904884000 0 44302527000 . . . . 40565780000 17397643000 85173884000 29 7 1.9225514 "civil" 3 2006 "Japan" "Industrials" 10.81193848 0 3.27123e+10 0 55434389000 . . . . 49907016000 22722089000 91927410250 29 7 1.65831 "civil" 3 2007 "Japan" "Industrials" 11.485807059 0 37987217000 0 67904667000 . . . . 67877062000 29917450000 86206776250 29 7 1.2695265 "civil" 3 2008 "Japan" "Industrials" 11.980931502 0 43520125000 0 71213581000 . . . . 76501281000 27693457000 27490824500 29 7 .38603345 "civil" 3 2009 "Japan" "Industrials" 4.674495311 14618000 44040615000 .033192089 63426922000 . . . . 57630157000 19386308000 27808637500 29 7 .43843585 "civil" 3 2010 "Japan" "Industrials" 1.101739175 97301000 43689814000 .222708662 59197927000 . . . . 34397382000 15508113000 27808637500 29 7 .469757 "civil" 3 2011 "Japan" "Industrials" .165256998 413255000 42687115000 .968102436 58821886000 . . . . 34216025000 16134769000 24074334750 29 7 .4092751 "civil" 3 2012 "Japan" "Industrials" 1.493754839 594312000 42946023000 1.383858058 59452007000 . . . . 36737657000 16505984000 35197789750 29 7 .592037 "civil" 3 2013 "Japan" "Industrials" 2.803754175 935148000 43636083000 2.143061283 61778664000 . . . . 39942216000 18142581000 38137560000 29 7 .6173257 "civil" 3 2014 "Japan" "Industrials" 3.455975106 944868000 45736948000 2.065874619 67053514000 . . . . 47493926000 21316566000 45685618750 29 7 .6813307 "civil" 3 2015 "Japan" "Industrials" 4.434744546 899785000 49154053000 1.83054081 72450350000 . . . . 49307128000 23296297000 64118772750 29 7 .8850029 "civil" 3 2016 "Japan" "Industrials" 6.018213661 1091580000 51743954000 2.109579797 80452131000 . . . . 57107866000 28708177000 65072211750 29 7 .8088315 "civil" 3 2017 "Japan" "Industrials" 6.231477171 991647000 55904069000 1.773836892 83831966000 . . . . 62608009000 27927897000 66264010500 29 7 .7904385 "civil" 3 2018 "Japan" "Industrials" 7.032425768 905803000 60950230000 1.486135491 80696070000 . . . . 61474323000 19745840000 46400698000 29 7 .57500565 "civil" 3 2019 "Japan" "Industrials" 6.686571029 429623000 65254877000 .658376844 84562176000 . . . . 61838950000 19307299000 59272124500 29 7 .7009295 "civil" 3 2020 "Japan" "Industrials" 5.884571192 487599000 67944954000 .717638281 82763661000 . . . . 58336392000 14818707000 72858630250 29 7 .8803215 "civil" 3 2021 "Japan" "Industrials" 6.8037589788 443321000 73321669000 .6046248074 90869562000 . . . . 59330782000 17547893000 61804283909 29 7 .6801429 "civil" 3 2022 "Japan" "Industrials" 6.222795439 397571000 76043752000 .5228187583 90559574000 . . . . 56591208000 14515822000 58977635572 29 7 .6512579 "civil" 4 2003 "Japan" "Basic Materials" 1.183512447 2.4016e+10 1.04113e+11 23.067244244 1.66331e+11 . . . . 1.52017e+11 6.2219e+10 88495370000 29 1 .53204376 "civil" 4 2004 "Japan" "Basic Materials" .467728206 2.3418e+10 1.0633e+11 22.023887896 1.77886e+11 . . . . 1.63835e+11 7.1556e+10 107785778500 29 1 .6059262 "civil" 4 2005 "Japan" "Basic Materials" 1.748275332 3.0239e+10 1.08101e+11 27.972914219 1.92765e+11 . . . . 1.84425e+11 8.4663e+10 200258817250 29 1 1.0388755 "civil" 4 2006 "Japan" "Basic Materials" 3.572108314 7.5635e+10 1.19782e+11 63.143878045 2.69595e+11 . . . . 2.24953e+11 1.49813e+11 143581793500 29 1 .5325833 "civil" 4 2007 "Japan" "Basic Materials" 1.943795675 7.4717e+10 1.22011e+11 61.237921171 2.74598e+11 . . . . 2.35637e+11 1.52587e+11 109177845750 29 1 .3975916 "civil" 4 2008 "Japan" "Basic Materials" 2.223022598 7.4281e+10 1.22622e+11 60.577221053 2.64038e+11 . . . . 2.53462e+11 1.41416e+11 57671357500 29 1 .21842067 "civil" 4 2009 "Japan" "Basic Materials" -5.945290437 7.3983e+10 9.9847e+10 74.096367442 2.20009e+11 . . . . 2.2206e+11 1.2016e+11 81137634000 29 1 .36879236 "civil" 4 2010 "Japan" "Basic Materials" 2.920724731 7.8806e+10 1.07666e+11 73.194880464 2.42342e+11 . . . . 1.74278e+11 1.34678e+11 109282046490 29 1 .4509414 "civil" 4 2011 "Japan" "Basic Materials" 6.460276573 5.7869e+10 1.18864e+11 48.685051824 2.40207e+11 . . . . 2.15453e+11 1.21343e+11 78353499500 29 1 .3261916 "civil" 4 2012 "Japan" "Basic Materials" 1.935465138 5.9239e+10 1.20964e+11 48.972421547 2.41951e+11 . . . . 2.27478e+11 1.20987e+11 80143300250 29 1 .3312377 "civil" 4 2013 "Japan" "Basic Materials" 2.24029193 5.1443e+10 1.26492e+11 40.668975113 2.38165e+11 . . . . 2.17279e+11 1.11673e+11 86507036250 29 1 .3632231 "civil" 4 2014 "Japan" "Basic Materials" 2.498054412 5.2263e+10 1.37669e+11 37.962794819 2.55259e+11 . . . . 2.3742e+11 1.1759e+11 84518368750 29 1 .3311083 "civil" 4 2015 "Japan" "Basic Materials" 2.558267074 4.5129e+10 1.53356e+11 29.427606354 2.68064e+11 . . . . 2.40647e+11 1.14708e+11 112163944500 29 1 .41842225 "civil" 4 2016 "Japan" "Basic Materials" .232386346 3.7678e+10 1.3936e+11 27.036452354 2.5176e+11 . . . . 2.1412e+11 1.124e+11 96639435060 29 1 .3838554 "civil" 4 2017 "Japan" "Basic Materials" 2.200176426 5.4741e+10 1.43032e+11 38.271855249 2.73107e+11 . . . . 2.12837e+11 1.30075e+11 89887771000 29 1 .3291302 "civil" 4 2018 "Japan" "Basic Materials" 3.252969429 4.7447e+10 1.51891e+11 31.237532178 2.75315e+11 . . . . 2.36237e+11 1.23424e+11 68310728625 29 1 .24811845 "civil" 4 2019 "Japan" "Basic Materials" 2.639632679 5.9776e+10 1.52638e+11 39.161938705 2.90294e+11 . . . . 2.57315e+11 1.37656e+11 76165965250 29 1 .26237527 "civil" 4 2020 "Japan" "Basic Materials" 3.316779808 5.9573e+10 1.54648e+11 38.52167503 2.8038e+11 . . . . 2.42262e+11 1.25732e+11 54827562975 29 1 .19554734 "civil" 4 2021 "Japan" "Basic Materials" 1.2809765354 7.5864e+10 1.92953e+11 39.3173467114 3.53043e+11 40.8158110852418 66.0959133971072 32.5250526716913 18.168629615998 2.02247e+11 1.6009e+11 49537707425 29 1 .14031635 "civil" 4 2022 "Japan" "Basic Materials" .5934966262 6.6667e+10 2.01548e+11 33.0774803025 3.644e+11 41.6077548356212 72.6957288042282 30.7774144263572 14.7980500402449 2.60117e+11 1.62852e+11 43134198075 29 1 .11837047 "civil" 5 2003 "Japan" "Industrials" -2.446869776 82000000 5.7565e+10 .142447668 6.8111e+10 . . . . 3.5646e+10 1.0546e+10 29838419000 29 7 .4380852 "civil" 5 2004 "Japan" "Industrials" .434378838 0 5.6186e+10 0 6.5413e+10 . . . . 3.9017e+10 9.227e+09 38940481932 29 7 .59530187 "civil" 5 2005 "Japan" "Industrials" 1.814341805 0 5.9413e+10 0 7.5685e+10 . . . . 4.3679e+10 1.627e+10 74635923703 29 7 .9861389 "civil" 5 2006 "Japan" "Industrials" 2.256423142 1.000e+09 6.078e+10 1.645278052 8.3505e+10 . . . . 5.4303e+10 2.2725e+10 59123048787 29 7 .7080181 "civil" 5 2007 "Japan" "Industrials" 3.520092179 0 6.4136e+10 0 9.007e+10 . . . . 6.212e+10 2.5934e+10 48596455094 29 7 .53954095 "civil" 5 2008 "Japan" "Industrials" 4.099348376 1.500e+09 6.1326e+10 2.445944624 8.5031e+10 . . . . 6.4513e+10 2.3706e+10 25960321288 29 7 .3053042 "civil" 5 2009 "Japan" "Industrials" 1.016130445 5.040e+08 5.7869e+10 .870932624 7.4791e+10 . . . . 6.0675e+10 1.6922e+10 21448923991 29 7 .28678483 "civil" 5 2010 "Japan" "Industrials" -17.437776319 1.002e+09 4.5706e+10 2.192272349 6.3862e+10 . . . . 3.4898e+10 1.8156e+10 29363656091 29 7 .4597986 "civil" 5 2011 "Japan" "Industrials" 1.872022562 2.562e+09 4.5216e+10 5.666135881 6.7333e+10 . . . . 4.0989e+10 2.2117e+10 28018151634 29 7 .4161132 "civil" 5 2012 "Japan" "Industrials" 4.10147656 2.459e+09 4.7472e+10 5.179895517 7.130e+10 . . . . 5.224e+10 2.3828e+10 53741030959 29 7 .7537311 "civil" 5 2013 "Japan" "Industrials" 4.9590009 2.325e+09 5.2978e+10 4.388614142 8.2118e+10 . . . . 5.7812e+10 2.914e+10 90148798619 29 7 1.0977958 "civil" 5 2014 "Japan" "Industrials" 5.896014901 2.491e+09 5.9639e+10 4.176797062 9.183e+10 . . . . 6.9594e+10 3.2191e+10 80496521853 29 7 .876582 "civil" 5 2015 "Japan" "Industrials" 6.301915149 1.891e+09 6.7254e+10 2.81172867 1.05126e+11 . . . . 7.6897e+10 3.7872e+10 92427387855 29 7 .8792058 "civil" 5 2016 "Japan" "Industrials" 5.621795028 4.663e+09 6.8758e+10 6.781756305 1.00609e+11 . . . . 7.5529e+10 3.1851e+10 81674878989 29 7 .8118049 "civil" 5 2017 "Japan" "Industrials" 4.92851917 4.470e+09 7.0834e+10 6.310528842 1.01683e+11 . . . . 6.7547e+10 3.0849e+10 101633302980 29 7 .9995112 "civil" 5 2018 "Japan" "Industrials" 4.434526679 4.111e+09 7.5358e+10 5.4552934 1.16108e+11 . . . . 7.3856e+10 4.075e+10 53099718441 29 7 .4573304 "civil" 5 2019 "Japan" "Industrials" 4.122597421 3.991e+09 7.6593e+10 5.210658937 1.11564e+11 . . . . 8.4082e+10 3.4971e+10 68267797843 29 7 .611916 "civil" 5 2020 "Japan" "Industrials" 3.801036731 4.491e+09 7.4171e+10 6.054927128 1.04114e+11 . . . . 6.9159e+10 2.9943e+10 67087174686 29 7 .6443627 "civil" 5 2021 "Japan" "Industrials" 1.2770114346 2.797e+09 7.6822e+10 3.6408841217 1.07787e+11 . . . . 5.8099e+10 3.0965e+10 74240362049 29 7 .6887692 "civil" 5 2022 "Japan" "Industrials" .8163449396 2.594e+09 7.7993e+10 3.3259395074 1.13933e+11 . . . . 6.2466e+10 3.594e+10 54100319959 29 7 .4748433 "civil" end format %ty year label values Country_H Country_H label def Country_H 29 "Japan", modify label values Industry_n Industry_n label def Industry_n 1 "Basic Materials", modify label def Industry_n 7 "Industrials", modify