BookmarkSubscribeRSS Feed
stancemcgraw
Obsidian | Level 7

 

 

AP002 3 23OCT2013

AP002 4 01NOV2013

AP002 5 01NOV2013

AP002 6 14AUG2014

AP002 7 05SEP2014

 

I am trying to sum the number of dates by week and by month. This is the format for my dates and IDs.....

3 REPLIES 3
ballardw
Super User

What would you expect the output to look like given that input?

is the result to be a data set or a report?

stancemcgraw
Obsidian | Level 7

So those dates are each time a person made a call. I want to total the number of dates per id every four weeks. (or analyze the change by every four weeks)

Ksharp
Super User

Add two format into two proc means :

 

 

data have;
input id $ n date date9.;
format date date9.;
cards;
AP002 3 23OCT2013
AP002 4 04NOV2013
AP002 5 07NOV2013
AP002 6 14AUG2014
AP002 7 05SEP2014
;
run;


proc summary data=have;
by id date;
var n;
format date monyy.;
output out=want1 sum=sum_n;
run;


proc summary data=have;
by id date;
var n;
format date weekv5.;
output out=want2 sum=sum_n;
run;

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2909 views
  • 0 likes
  • 3 in conversation