I am currently working on a panel dataset (15 EU countries for 15 years). I have approximately 7300 data comprising of fundamentals information from multiple companies from different countries and year. I have a regression equation that look like this PB = b0 + b1roe + b2leverage + b3RND etc., + e
I would like to run a regression that allows for each treatment variable (roe,leverage,rnd) to be separately estimated by the month, year and country, with fiscal years falling in the 12-month window ending in month m-1 of year y. For example coefficient for march 2008 are estimated by country using all firms with fiscal year end from 2007 through February 2008. Therefore the beta or coefficient would look like this Bcmy. The desired outcome that I would like to obtain out of this equation is the median coefficient and standard errors by year (from 2002 to 2016).
I tried using the ssc asreg "bysort year CurrentFiscalYearEndMonth CurrentISOCountryCodeIncor: asreg PB ROEready RNDready LEVready" however the outcome generates some missing value which I am also not sure whether this is the right code to use.
I tried to generate the data through dataex as seen below
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(PBready ROEready LEVready RNDready) int year byte CurrentFiscalYearEndMonth str3 CurrentISOCountryCodeIncor 2.501992 .22056963 1.4670886 .0439127 2002 1 "FRA" .9965728 -.010727056 .04386174 .2514096 2002 1 "FRA" 2.78899 .0900184 .5920326 .008851121 2002 3 "FRA" .6334071 -.11643155 .5996423 .016627148 2002 3 "FRA" 6.608397 -.1338486 .3021003 .024569996 2002 3 "FRA" .0971978 .0020639836 1.1801376 .07070528 2002 3 "FRA" 1.6154306 -.05894583 .1180996 .07520621 2002 5 "DEU" .22132427 .15421036 .1815995 .02372183 2002 6 "FRA" 4.01267 .33485195 .5054485 .08253022 2002 6 "FRA" .6657547 -.10321123 0 .015558808 2002 8 "DEU" .05388878 -.9597693 .4103953 .051802 2002 9 "DEU" 3.379321 .070527285 0 .1678453 2002 9 "DEU" .3793055 -.17807257 .04592275 .1870879 2002 9 "DEU" .51270676 .011335916 .015425456 .17126264 2002 9 "DEU" 2.5424826 .03546665 .3734435 .10433023 2002 9 "DEU" 1.4651828 .11041197 .4354832 .06926062 2002 9 "DEU" .17458844 .29191756 .017979816 .0490125 2002 9 "NLD" .4889281 -.3171233 0 .2578869 2002 9 "NLD" 2.655715 -.05951535 .3898171 .01935532 2002 12 "BEL" .5394989 -.0884109 .13530505 .06627381 2002 12 "BEL" 2.011141 .14027476 .48083875 .0529575 2002 12 "BEL" 1.8065038 .1687703 .3916336 .05013892 2002 12 "BEL" 2.745315 .0994887 .3052833 .002145309 2002 12 "BEL" .19615325 -.06549847 .55540633 .07967845 2002 12 "BEL" 3.0185804 .24911647 .04999597 .14057754 2002 12 "BEL" 1.287757 .0422771 .7376518 .005315501 2002 12 "BEL" .10233635 -.3386864 .2086739 .01466511 2002 12 "BEL" 4.376657 .15507407 .2499764 .015744422 2002 12 "BEL" 14.962033 .1698887 .0017574693 .01961198 2002 12 "DEU" 4.5375695 .3372018 .1029913 .05714334 2002 12 "DEU" .8751419 .01844172 .16250384 .01863337 2002 12 "DEU" 2.1571429 -.8049549 .4088401 .06344415 2002 12 "DEU" 5.442753 .10837727 .22085787 .025447164 2002 12 "DEU" .3769042 -1.703446 .4426773 .1858746 2002 12 "DEU" 4.953071 -1.1824311 .11398914 1.169183 2002 12 "DEU" 1.556017 .10869005 .0041701626 .01640392 2002 12 "DEU" .4467585 -.7064934 .0003442246 .04234625 2002 12 "DEU" 1.3440048 .02798005 .10274063 .016996719 2002 12 "DEU" 5.87459 .2083515 0 .005855615 2002 12 "DEU" 2.8817124 .1805593 1.2459283 .020198647 2002 12 "DEU" .4881609 -.44505045 .000030900916 .031418554 2002 12 "DEU" 1.92073 -.8516082 .3737817 .2123062 2002 12 "DEU" 1.0306753 -.011357614 .14795184 .05718863 2002 12 "DEU" .51089525 -.20148303 .11809663 .012979218 2002 12 "DEU" .10291866 -1.0448582 0 .1602102 2002 12 "DEU" .5730759 .05065738 .2975638 .01983557 2002 12 "DEU" .3598839 .05911022 .0911895 .03530624 2002 12 "DEU" .6664566 -.7726374 .4177446 .0062833 2002 12 "DEU" .6160062 -.6003456 0 .28277555 2002 12 "DEU" 2.642094 .12900597 .7688438 .029153215 2002 12 "DEU" 2.1150463 .01605743 .45360425 .04826149 2002 12 "DEU" 2.52395 -.4510309 .1572165 .10676835 2002 12 "DEU" .3107454 -.6736197 .04059732 .32876635 2002 12 "DEU" .376853 -.02921353 0 .11302073 2002 12 "DEU" .66889 -.54542226 0 .8584071 2002 12 "DEU" 1.8121578 .20726496 .6012821 .00886501 2002 12 "DEU" 4.774646 .12061794 .7546643 .08138523 2002 12 "DEU" .3817754 .010508094 .08953138 .1097979 2002 12 "DEU" 1.0852587 -.15649834 .04431737 .031412087 2002 12 "DEU" .37710705 -.29013616 .01022627 .07242809 2002 12 "DEU" 1.6711057 -1.1101563 0 .001792452 2002 12 "DEU" .479313 .09309833 .4775604 .028163636 2002 12 "DEU" .4903025 -.015567716 .5357945 .011187978 2002 12 "DEU" 2.2117758 -.12586667 1.3621334 .022835566 2002 12 "DEU" .7684557 .1396861 1.397262 .04058616 2002 12 "DEU" .5806255 .01517721 .033352893 .013543376 2002 12 "DEU" .8207924 .05363528 .4306714 .02150873 2002 12 "DEU" .09770728 -.8172043 .018330773 .0487846 2002 12 "DEU" 1.0410833 .09805055 0 .08020724 2002 12 "DEU" 1.342729 .09005567 .17294085 .02836905 2002 12 "DEU" .7030928 .22867852 .26641548 .01980642 2002 12 "DEU" .8065854 .07882356 .3304667 .15993802 2002 12 "DEU" 1.2576966 .13509406 .9230101 .04756161 2002 12 "DEU" 1.0136155 .02376993 .10587818 .13083273 2002 12 "DEU" .3626794 .00691348 .08633968 .06181116 2002 12 "DEU" .15556324 -.07540452 .12750772 .09831785 2002 12 "DEU" 2.883697 -.02713133 .6812069 .01051874 2002 12 "DEU" 3.074653 .04581846 .9110928 .016970545 2002 12 "DEU" .3446856 .02930433 .7991381 .03324976 2002 12 "DEU" 1.3887497 .10213708 .0019612485 .04050211 2002 12 "DEU" 1.8156796 .07802318 .0001153336 .03104684 2002 12 "DEU" .5976862 .06912292 .477209 .08743697 2002 12 "DEU" 2.3231912 .09092283 .11250521 .0352408 2002 12 "DEU" .9926935 .13176306 1.111882 .04305637 2002 12 "DEU" .3765133 -.28253514 0 .17025778 2002 12 "DEU" .5812076 -1.0716673 2.598589 .003095494 2002 12 "DEU" 1.6630104 .18955117 .09466209 .06890064 2002 12 "DEU" 3.652923 .08902733 .018388264 .1670039 2002 12 "FIN" 1.470671 -.3428717 .36101705 .025584945 2002 12 "FIN" 4.182527 .14893901 .4090635 .02173701 2002 12 "FIN" 1.906931 .07947977 .6933526 .004391408 2002 12 "FIN" 1.264242 .11295794 .56071913 .003408683 2002 12 "FIN" .9243179 -.26771626 .02717709 .04061502 2002 12 "FIN" 21.843977 .19158944 .7642595 .01773771 2002 12 "FIN" 3.443972 .19592 .618259 .03777195 2002 12 "FIN" 15.830564 .15597697 1.0701946 .01451011 2002 12 "FIN" 1.0098228 .10721224 .5146916 .00549426 2002 12 "FIN" 1.6306534 .11560883 .3356914 .08539633 2002 12 "FIN" .6516293 .08572516 .02020032 .04574978 2002 12 "FIN" .689446 .07452567 .5525226 .008627627 2002 12 "FIN" end
My question would be:
1. Did I use the right command? if not
2. What would be the right code to obtain this coefficient betacmy.
Thank you in advance.
Best,
Kevin
0 Response to Problem in running regression with beta/coefficient that are estimated based on month, year, and country
Post a Comment