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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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