Hi all,
I just started using STATA, so I don't have much knowledge about it.
My problem is the following:
I have downloaded monthly stock return data from CRSP for 5 years (2012-2016) and have to calculate an individual beta for each stock, as a control variable in estimating the ex-ante cost of equity. This is estimated as the slope coefficient obtained by regressing the returns on the market return (S&P return) for the 36 months prior to the measurement of the ex-ante cost of equity.
So for a particular stock and a particular month, I want to regress the returns from the last 3 years on the market returns.
For example stock Apple: beta in end December 2014 would be a regression of Apple's returns from January 2012 till December 2014 on the market returns during this period.
This way, i want to have a beta for December 2014 and 2015 for every firm, so i am able to merge them to another stata file.
I have to include another restriction: firms with missing data have to be excluded, so if firms do not have the 36 months stock returns needed, i need to drop them.
I hope someone can answer these tons of questions, I would be very grateful!
Thanks in advance,
Tim
I just started using STATA, so I don't have much knowledge about it.
My problem is the following:
I have downloaded monthly stock return data from CRSP for 5 years (2012-2016) and have to calculate an individual beta for each stock, as a control variable in estimating the ex-ante cost of equity. This is estimated as the slope coefficient obtained by regressing the returns on the market return (S&P return) for the 36 months prior to the measurement of the ex-ante cost of equity.
So for a particular stock and a particular month, I want to regress the returns from the last 3 years on the market returns.
For example stock Apple: beta in end December 2014 would be a regression of Apple's returns from January 2012 till December 2014 on the market returns during this period.
This way, i want to have a beta for December 2014 and 2015 for every firm, so i am able to merge them to another stata file.
I have to include another restriction: firms with missing data have to be excluded, so if firms do not have the 36 months stock returns needed, i need to drop them.
I hope someone can answer these tons of questions, I would be very grateful!
Thanks in advance,
Tim
Comment