Hi All,
I want to calculate Annual stock returns by compounding monthly stock returns for a twelve-month period ending four months after the end of the fiscal year of the firm. The information I have includes firm_ticker (firm identifier), dates, and fiscal_year_end.
The sample consists of around 4000 unique firms with information for the period 2004 to 2012. Mostly the firms have fiscal year end of December, March, June, and September. The subsample of the data looks as follows
FIRM_TICKER | DATES | FISCAL_YEAR_END | PRICE |
A | 1/31/2004 | 9 | 8.5 |
A | 2/28/2004 | 9 | 8.25 |
A | 3/31/2004 | 9 | 8.6 |
A | 4/30/2004 | 9 | 9 |
A | 5/31/2004 | 9 | 8.33 |
A | 6/30/2004 | 9 | 8.4 |
A | 7/31/2004 | 9 | 8.6 |
A | 8/31/2004 | 9 | 8.9 |
A | 9/30/2004 | 9 | 8.75 |
A | 10/31/2004 | 9 | 8.8 |
A | 11/30/2004 | 9 | 8.4 |
A | 12/31/2004 | 9 | 8.22 |
A | 1/31/2005 | 9 | 8.9 |
A | 2/28/2005 | 9 | 8.75 |
A | 3/31/2005 | 9 | 8.8 |
A | 4/30/2005 | 9 | 8.4 |
A | 5/31/2005 | 9 | 8.22 |
A | 6/30/2005 | 9 | 8.4 |
A | 7/31/2005 | 9 | 8.6 |
A | 8/31/2005 | 9 | 7.9 |
A | 9/30/2005 | 9 | 7.8 |
A | 10/31/2005 | 9 | 8 |
A | 11/30/2005 | 9 | 8.2 |
A | 12/31/2005 | 9 | 8.25 |
I would appreciate if someone could share the code for annual return calculation.
Thanks in advance.
Can you please provide a data step which creates sample data and then also give us a sample of how the result should look like?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.