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?
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.