BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Astounding
PROC Star

It was a good year, but it shouldn't be that good.

 

Calculations come out to 91.8%

 

Questions to consider:

 

  • Is this the first ticker/year in the data?  (If not, what was in the observation just prior to this?)
  • Are the RET values verified from the SAS data set, vs. from another source that was imported into SAS?  There might be a need to verify what is in the SAS data set for those months.
sastuck
Pyrite | Level 9

How can I use this code to calculate the geometric mean of the monthly values instead? (which takes several values and multiplies them together and sets them to the 1/nth power). Thanks for the help!

Astounding
PROC Star

If memory serves, we never adjusted the program for tickers that did not end with a valid value in month 12.  That should be added in where the current statement reads:

 

if month=12;

 

That should become:

 

if month=12 or last.ticker;

 

This wouldn't affect the first ticker.  While it's hard to imagine a ticker coming before AA, I believe Agilent (A) comes before Alcoa (AA).

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

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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
  • 32 replies
  • 3920 views
  • 5 likes
  • 4 in conversation