A code to create subgroups and regressions
Posted: Sun Mar 14, 2010 9:01 am
Dear friends,
I have spend hours and hours browsing the forums but I haven't found what I am looking for. I am quite sure that this will seem preety basic for you but I am a beginer in programming and would realy appreciate if you could help me out with several simple programming codes. I am writing my master thesis and analyzing an event study of mergers and acquisitions. I will test the risk of acquiring companies around the event by retreiving a beta from the CAPM and Fama&French three factor model. I retreived all the necessary daily data for three years before and after the event.
(CAPM) Ri - Rf = ai + Bi (Rm - Rf)
In Eviews I have now created series for both,each firm's excess returns (denoted by Y) and market premium (denoted by X). Here I would kindly like to ask you if someone could please post a code that will allow me to create subgroups of 30 days/observations ie. 72 groups for both previously mentioned variables (firm's excess returns, market premia) for the entire event window? The latter will be later used for capturing the beta dynamics.
I have read the introduction of eviews programming post several times but I humbly ask you to also write me the FOR loop code that would regress each of the excess return subgroup with the relevant subgroup of market premia and save the regressions and perhaps additionally save the obtained coefficients separately?
I am aware that some of the things have been partially answered already but I have really spend a lot of time working it out and I could not do it. Therefore, I again kindly ask you for few minutes of your time to help me out. Thanks a lot in advance.
Regards
p.s. I'm using Eviews 6
I have spend hours and hours browsing the forums but I haven't found what I am looking for. I am quite sure that this will seem preety basic for you but I am a beginer in programming and would realy appreciate if you could help me out with several simple programming codes. I am writing my master thesis and analyzing an event study of mergers and acquisitions. I will test the risk of acquiring companies around the event by retreiving a beta from the CAPM and Fama&French three factor model. I retreived all the necessary daily data for three years before and after the event.
(CAPM) Ri - Rf = ai + Bi (Rm - Rf)
In Eviews I have now created series for both,each firm's excess returns (denoted by Y) and market premium (denoted by X). Here I would kindly like to ask you if someone could please post a code that will allow me to create subgroups of 30 days/observations ie. 72 groups for both previously mentioned variables (firm's excess returns, market premia) for the entire event window? The latter will be later used for capturing the beta dynamics.
I have read the introduction of eviews programming post several times but I humbly ask you to also write me the FOR loop code that would regress each of the excess return subgroup with the relevant subgroup of market premia and save the regressions and perhaps additionally save the obtained coefficients separately?
I am aware that some of the things have been partially answered already but I have really spend a lot of time working it out and I could not do it. Therefore, I again kindly ask you for few minutes of your time to help me out. Thanks a lot in advance.
Regards
p.s. I'm using Eviews 6