Help using Base SAS procedures

proc summary class with ranges possible?

Reply
Contributor
Posts: 28

proc summary class with ranges possible?

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.

Respected Advisor
Posts: 3,156

Re: proc summary class with ranges possible?

Hint: Proc format to group the range.

Super User
Posts: 19,785

Re: proc summary class with ranges possible?

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

Respected Advisor
Posts: 3,156

Re: proc summary class with ranges possible?

And I hope it is me Smiley Happy

Contributor
Posts: 28

Re: proc summary class with ranges possible?

Haha, typo there!

Ask a Question
Discussion stats
  • 4 replies
  • 185 views
  • 1 like
  • 3 in conversation