Help using Base SAS procedures

Average per month from daily series

Reply
Contributor
Posts: 32

Average per month from daily series

How could I calculate out a daily series a monthly average. For example

26-Oct-09 1.065
27-Oct-09 1.063
28-Oct-09 1.082
29-Oct-09 1.068
30-Oct-09 1.08
02-Nov-09 1.07
03-Nov-09 1.06
04-Nov-09 1.062

How to get the monthly average of these (for Oct 09 and Nov 09).
Thanks for your help.
Respected Advisor
Posts: 3,777

Re: Average per month from daily series

Formats, to create groups. In this case MONYY.

[pre]
data have;
input date:date. y;
format date date9.;
cards;
26-Oct-09 1.065
27-Oct-09 1.063
28-Oct-09 1.082
29-Oct-09 1.068
30-Oct-09 1.08
02-Nov-09 1.07
03-Nov-09 1.06
04-Nov-09 1.062
;;;;
run;
proc means;
class date;
format date monyy.;
run;
[/pre]
Ask a Question
Discussion stats
  • 1 reply
  • 774 views
  • 0 likes
  • 2 in conversation