I am not sure if this is a specific Stata question, if not I am sorry.
I am working on a dataset that has monthly data of stock returns from banks as dependend variable (variable = exreturn) and independend variables which are "mktminusrf" "smb_5" "hml" "rmw" "cma" "funding". When I do my regression without holding for time-fixed effects I am getting the right results
Code:
reg exreturn mktminusrf smb_5 hml rmw cma funding, vce(robust)
Everytime when I read something here or watch a video I always see that the fixed effects are hold by an "ID" and the panel date is set up like this
Code:
xtset id year, yearly
Code:
xtreg y x1 x2, fe
Therefore my question might be more a theoretical question, I hope this is okay and somebody can help me out:
Is it possible to run a time-fixed regression with this dataset that you see below? And if yes, how should I set my panel data up.
My idea was to hold for fixed year or month but doing this poriveds me a result which I believe cannot be correct
Code:
reg exreturn mktminusrf smb_5 hml rmw cma funding i.year, robust
Extra information: The variable exreturn (dependend variable) is a Portfolio of 40 stocks from the same industry
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int year byte month double(funding smb_5 hml rmw cma rf exreturn) 2010 1 -.3933305349832981 .25 .61 -1.18 .41 0 . 2010 2 -.4309383413670224 1.53 2.74 -.55 1.43 0 1.079242090318634 2010 3 -.0141456717752401 1.85 2.01 -.9 1.67 .01 7.86393930364869 2010 4 -.3451440767419464 5.03 3.12 .49 1.69 .01 7.512007394694056 2010 5 -.4262781423107988 -.08 -2.32 1.38 -.18 .01 -7.985979824222703 2010 6 -.371163521472528 -2.59 -4.27 -.34 -1.48 .01 -6.335626764257626 2010 7 -.024398109698932 .13 .04 .32 2.03 .01 2.881855746293185 2010 8 -.4337655287944647 -3.07 -1.51 .34 -2.13 .01 -9.47372995462771 2010 9 -.2048099491622005 3.71 -2.94 -.01 .39 .01 6.938139934459893 2010 10 -.0729573838647816 .72 -2.23 1.46 -.16 .01 -1.05813682753868 2010 11 -.3881111120403277 3.54 -.58 -.1 1.76 .01 -.2466604777739863 2010 12 .1058078519319547 1.03 3.47 -3.44 3.44 .01 14.13006373515285 2011 1 -.3926004371311564 -2.38 .68 -1.07 .8 .01 -.7969297791341908 2011 2 -.4062703543627456 1.76 1.73 -1.76 .72 .01 .5468279827189715 2011 3 -.3648256507560639 2.66 -1.16 1.21 -.03 .01 .9523648032545907 2011 4 -.4321655271184945 -.41 -2.15 .96 -1.28 0 .5892439640544306 2011 5 -.3267984264572796 -.69 -2.12 2.02 -1.46 0 -1.49001583687659 2011 6 -.2500915499918396 .09 -.26 2.16 -1.4 0 -2.242232233723338 2011 7 -.3658353605515791 -1.38 -1.18 2.41 -1.75 0 -3.803201280158997 2011 8 -.3068993764872049 -3.39 -1.58 2.79 -.23 .01 -10.01027367894514 2011 9 -.26837506428909 -3.9 -.98 1.71 .24 0 -9.691976652945483 2011 10 -.3872412082164993 3.72 -.96 -1.42 -.86 0 14.10180765195524 2011 11 -.4345422286371686 -.34 -.18 1.46 1.52 0 -.7010521563359489 2011 12 -.4031635549919299 -.36 1.57 .59 2.44 0 2.80698102953636 2012 1 -.2686391422356094 2.35 -2.14 -1.05 -1.41 0 4.812300227465119 2012 2 -.4327092170083873 -1.54 .01 -.17 -.03 0 4.929256079524911 2012 3 -.4036606428912604 -.3 -.06 .25 .77 0 6.134441796438536 2012 4 -.4073266661488228 -.66 -.2 .96 .72 0 -.6589440873023984 2012 5 -.392320825187783 -.2 .08 1.98 2.37 .01 -5.232003502156303 2012 6 -.3499596157667108 .99 .54 -1.48 .37 0 3.161005632020767 2012 7 -.3997460756840325 -2.74 .01 .68 .12 0 -2.194379715301951 2012 8 -.2152798630418495 .61 .6 -.77 -.69 .01 3.209782285250071 2012 9 -.3207090996904808 .69 1.56 -1.14 1.57 .01 3.744035044489593 2012 10 -.3458741745940881 -.8 4.16 -1.35 2.28 .01 -.0112728353654932 2012 11 -.4301461075274643 .41 -1.12 .94 .93 .01 -1.707135468131021 2012 12 -.348421750078157 1.91 3.26 -1.75 .88 .01 3.042648155235065 2013 1 -.3217032754891418 .57 1.34 -1.88 1.47 0 4.353588346029981 2013 2 -.3033110232139128 -.35 .28 -.96 .49 0 1.795811335142117 2013 3 -.3892140258169673 .9 -.07 .13 1.21 0 4.731694854308732 2013 4 .0938156063606059 -2.32 .35 .04 .39 0 -1.228710327935455 2013 5 -.1475205687643588 2.27 1.33 -.71 -.83 0 4.940060638818191 2013 6 -.3079867562669904 1.33 -.4 -.47 .01 0 2.524169010641897 2013 7 -.2844372170362073 1.81 .71 -1.43 .53 0 7.810874448103843 2013 8 -.3654470106302271 -.03 -2.48 .85 -2.13 0 -3.497821482444668 2013 9 -.0458660933512685 2.72 -1.57 -.1 -1.32 0 1.662269053409684 2013 10 .1428253664352239 -1.57 1.36 2.83 .89 0 3.530331927754367 2013 11 -.311854721483656 1.47 -.38 .77 .12 0 5.958017535781948 2013 12 -.3969188882565902 -.44 -.2 -.57 .07 0 1.758179600545098 2014 1 -.4001033576116764 .56 -1.88 -4.5 -1.42 0 -3.509387301462624 2014 2 -.2543478651298571 .16 -.49 -.49 -.4 0 2.497577726394331 2014 3 -.0462855112663287 -1.23 4.6 1.76 1.91 0 4.418488481502361 2014 4 .3741421135893079 -4.21 1.62 2.85 1.09 0 -5.144931450627418 2014 5 -.214192483262064 -1.83 -.38 .45 -1.09 0 -.1524946883270472 2014 6 5.119203394626711 3.04 -.6 -1.9 -1.9 0 5.056250663074426 2014 7 .6428957931617213 -4.16 .04 1.48 .44 0 -3.606526297369947 2014 8 -.0663865031955063 .3 -.76 -.91 -.65 0 2.334665259623833 2014 9 -.2642274871290511 -3.8 -1.68 1.28 -.62 0 -2.045957417917509 2014 10 -.2376954205022849 3.79 -1.81 -.78 -.18 0 3.921821214508064 2014 11 -.2130740354885704 -2.27 -3.37 1.69 .15 0 .2556962153253985 2014 12 2.6553250856076 2.85 1.56 -1.52 .81 0 1.699910054766814 2015 1 -.2924061574223497 -.91 -3.06 1.09 -1.67 0 -9.063475876310159 2015 2 -.2044215992408486 .35 -2.16 .06 -1.62 0 7.821358748819074 2015 3 -.1474428987800883 3.07 -.73 .16 -.54 0 1.178161237891585 2015 4 1.668465799464843 -2.99 2.13 .41 -.49 0 1.169923120498791 2015 5 .1219010726727801 .85 -1.9 -1.54 -.68 0 2.282959490396854 2015 6 .1296991390935276 2.88 -1.04 1.03 -1.51 0 4.042932941219418 2015 7 .3822663939439909 -4.5 -4.49 .31 -2.6 0 -.4668957188768061 2015 8 .2912371723790906 .38 2.88 .75 1.14 0 -5.438906417704657 2015 9 .4157110891708222 -2.81 .73 1.66 -.5 0 -1.03380138198852 2015 10 5.63291267059109 -2.05 -.32 1.19 .45 0 4.103701862358857 2015 11 .1172253396197023 3.35 -1.23 -2.11 -1 0 4.884271693531828 2015 12 -.382441203188589 -3 -2.07 .45 .17 .01 -5.998214832502895 2016 1 -.1641108774045147 -3.56 3.13 2.27 3 .01 -9.570953046717952 2016 2 -.3199323998477768 .87 -.03 2.44 2.09 .02 -3.224477640041395 2016 3 -.0534622178129129 1.01 1.3 .58 .07 .02 7.358411454974729 end
Thanks
0 Response to Time Fixed Effect without having a dummy variable possible?
Post a Comment