BookmarkSubscribeRSS Feed
pinkyc
Calcite | Level 5

I have data as such:

PatID     Age     Num_1     Num_2     Den

A          18          0               1               1

B          330         0               1               1

C          65          1               1               1

D          44          1               0               1

E          70          1               1               1

F          20          0               0               1

...

I know that using this:

proc summary data=pat_info;

class Age;

var Num_1 Num_2 Den;

output out=pat_infosum sum=;

run;

Would give me an output where Num_1, Num_2 and Den with 1's are summed for each age, however, is there a way to set a range for the class?  Something like 18-64 and 65+ so that the Num_1 and Num_2 are summed by a range of ages, not each age.

4 REPLIES 4
Haikuo
Onyx | Level 15

Hint: Proc format to group the range.

Reeza
Super User

Hope you don't have someone who is 330 Smiley Happy

Haikuo
Onyx | Level 15

And I hope it is me Smiley Happy

pinkyc
Calcite | Level 5

Haha, typo there!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 4 replies
  • 960 views
  • 1 like
  • 3 in conversation