BookmarkSubscribeRSS Feed
AAWTomHanks
Calcite | Level 5

I need to create a new column called Age_Bracket and I want it to include age ranges. I have an Age column already with numbers ranging from 0 to 99. If the Age column falls within lets say 0 to 25 I want the new column to say '0-25', if the age is between 26 and 64 I want the new column to say '26-64', and if the age is 65+ I want the new column to say '65+'. Any help would be greatly appreciated.

1 REPLY 1
art297
Opal | Level 21

proc format;

  value ages

  0-25="0-25"

  26-64="26-64"

  65-high="65+"

  ;

run;

data have;

  input age;

  age_bracket=put(age,ages.);

  cards;

0

1

2

15

27

88

;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 636 views
  • 0 likes
  • 2 in conversation