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

;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1 reply
  • 581 views
  • 0 likes
  • 2 in conversation