BookmarkSubscribeRSS Feed
brophymj
Quartz | Level 8


Is there an easy way of creating band in SAS? I have a dataset where I would like to create bands for certain factors i.e. age etc. based on the volumn of data.

3 REPLIES 3
LinusH
Tourmaline | Level 20

Is "band" a statistical term? If so, post this in Statistical Procedures forum instead to target your audience.

Data never sleeps
brophymj
Quartz | Level 8

Not really. I just want to create something like the following:

Age  Band

24     A.18-25

44     C.25-44

23     ...

65     ...

99

without having to define each level manually

So, given the width, lower and upper bounds i can create bands automatically

user24feb
Barite | Level 11

Proc Format should work:


Data A;
  Input Age @@;
  Datalines;
  24 44 23 65 99 
  ;
Run;

Proc Format;
  Value AgeFormat 18-25  = "A"
                               25-44  = "C"
                               44-High = "Old" ;
Run;

Data B;
  Set A;
  Group=Put(Age,AgeFormat.);
Run;

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
  • 3 replies
  • 2094 views
  • 0 likes
  • 3 in conversation