SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
jbrock
Fluorite | Level 6

Hello,

I have a dataset containing observations over the course of 3 years. How can I calculate the average number of observations by month? So, for instance, I have a number of observations from January 2015, 2016, and 2017. How can I calculate the 3-year average value of observations that occurred in January (and every other month)?

I hope to end up with average as a separate value that I can plot on a bar chart.

A small sample of my dataset is attached.  I am basing all of my date calculations on DtSpec2.

Thanks!

1 REPLY 1
PaigeMiller
Diamond | Level 26

This was answered in your other thread, in particular in message 16 https://communities.sas.com/t5/Graphics-Programming/Add-average-line-to-bar-chart/m-p/615663#M19297

--
Paige Miller

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 884 views
  • 0 likes
  • 2 in conversation