I have an unbalanced panel dataset that has observations of each firm, based on firmID, for a long time period e.g. 1970-2017. So observations of firm X for the time period 1970-2017, Firm Y for the period 1990-2012 etc.. The columns do not only have FirmID and Year, but also three other variables:
- Rf: ''Risk-free return rate'': The return based on government bonds.
- Rm: ''Market index-Return'' : which is the market stock return based on MSCI World Index
- Rm-Rf : the difference between Rm and Rf which is the excess return over the government bonds
- Re: ''Firms stock return'': the return of a particular firm for a particular year, e.g. return for Firm X in year 2012 etc..
Now I want to regress the following for each observation, so for every year of each firm(ID): Re= Rf + x1(Rm - rf) The idea is that the x1 of each regression is saved in a separate column next to the other columns, where (in every row) the x of each year of each firm is presented.
However, I am not sure if this is the right way. Can someone check this for me? I did: bysort FirmID (Year): regress Re Rf (Rm-Rf)
But I do not know if it must be regress Re Rf (Rm-Rf) or regress Re (Rm-Rf), but without Rf I guess STATA would not put the same Rf in the regression but just a random constant α.
Last but not least, the command does not do exactly what I want. What am I doing wrong?
Comment