Dear statalist members,
Unfortunately I'm stuck with my analysis and I cannot find further information anywhere. Hopefully someone else already dealt with this kind of problem.
I have to generate the stock return volatility (=standard deviation) of daily stock returns on a per firm and per fiscal year basis.
Starting with daily stock returns (from CRSP) for a large number of firms between 1993 and 2013, I will have to arrive to 1 line for return volatility per firm-year. The main problem here: the accounting data from Compustat, to which stock return volatility should be merged, is on a fiscal year basis. The included firms have different fiscal year end-dates and some even change their end-dates over time.
So my question is: what should my code be to arrive at this 1 line per firm-year such that my complete dataset at the end looks like the following:
Firm fyear fyr (end-date) sales return volatility (%)
1 1996 6 1000 2.5
1 1997 6 1100 1.8
2 2004 12 500 3.7
2 2009 3 800 1.5
3 1999 12 2200 2.2
Many thanks and best regards,
Fabian
Unfortunately I'm stuck with my analysis and I cannot find further information anywhere. Hopefully someone else already dealt with this kind of problem.
I have to generate the stock return volatility (=standard deviation) of daily stock returns on a per firm and per fiscal year basis.
Starting with daily stock returns (from CRSP) for a large number of firms between 1993 and 2013, I will have to arrive to 1 line for return volatility per firm-year. The main problem here: the accounting data from Compustat, to which stock return volatility should be merged, is on a fiscal year basis. The included firms have different fiscal year end-dates and some even change their end-dates over time.
So my question is: what should my code be to arrive at this 1 line per firm-year such that my complete dataset at the end looks like the following:
Firm fyear fyr (end-date) sales return volatility (%)
1 1996 6 1000 2.5
1 1997 6 1100 1.8
2 2004 12 500 3.7
2 2009 3 800 1.5
3 1999 12 2200 2.2
Many thanks and best regards,
Fabian
Comment