BookmarkSubscribeRSS Feed
shalmali
Calcite | Level 5

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
A1/31/200498.5
A2/28/200498.25
A3/31/200498.6
A4/30/200499
A5/31/200498.33
A6/30/200498.4
A7/31/200498.6
A8/31/200498.9
A9/30/200498.75
A10/31/200498.8
A11/30/200498.4
A12/31/200498.22
A1/31/200598.9
A2/28/200598.75
A3/31/200598.8
A4/30/200598.4
A5/31/200598.22
A6/30/200598.4
A7/31/200598.6
A8/31/200597.9
A9/30/200597.8
A10/31/200598
A11/30/200598.2
A12/31/200598.25

I would appreciate if someone could share the code for annual return calculation.

Thanks in advance.

1 REPLY 1
Patrick
Opal | Level 21

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?

sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1364 views
  • 0 likes
  • 2 in conversation