BookmarkSubscribeRSS Feed
sz247
Calcite | Level 5

In the Bank data, the client's age is individual figuer. I want to group them into several group for my analysing purpose. May I know how to do it? any link for it? Thanks. 

5 REPLIES 5
ghosh
Barite | Level 11

Use proc format to create your age ranges

 

PaigeMiller
Diamond | Level 26

What analysis do you intend to do?

--
Paige Miller
sz247
Calcite | Level 5
Hi Thank you for your reply.
A Portuguese bank provided a direct marketing campaign, selling term-deposit product by calling its customers. THe data includes customers' age. I want to show the age distribution and yes/no subscription through a stack bar chart. I need to group age into several groups.
PaigeMiller
Diamond | Level 26

Then I agree with @ghosh and @Reeza, use PROC FORMAT to create the groups, then apply the format to the variable age.

--
Paige Miller
Reeza
Super User

Use PROC FORMAT

https://github.com/statgeek/SAS-Tutorials/blob/master/proc_format_example.sas

https://support.sas.com/resources/papers/proceedings/proceedings/sugi30/001-30.pdf

 

Or use IF/THEN statements

https://gist.github.com/statgeek/227565537f3dffcd8627f1fe2eff844f

 


@sz247 wrote:

In the Bank data, the client's age is individual figuer. I want to group them into several group for my analysing purpose. May I know how to do it? any link for it? Thanks. 


 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1187 views
  • 0 likes
  • 4 in conversation