BookmarkSubscribeRSS Feed
kayne
Calcite | Level 5

Hi all,

As you guys know that before anyone could start off with PROC GENMOD, they may be consider doing bucketing for their class/independent variables.

I am currently interested in doing a loop macro for the bucketing. The criteria will be ensuring that the maximum number of buckets for each variable is 5 and each variable bucket will have at least 5% of frequency, thus we might need to incorporate cumulative frequency into the loop.

Sadly to say, I know what I want to do, but I am unsure how to actually create the loop macros for SAS to automatically do the bucketing for me according to the criteria.

Will appreciate all feedback and ideas! Thanks for the help Smiley Happy

1 REPLY 1
ballardw
Super User

Before getting into any macro code for grouping I tend to look at Proc Format to assign group values. Most procedures will use the formatted value for groups. I would look at proc freq or univariate output to find likely values to set the boundary values for the format.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 840 views
  • 0 likes
  • 2 in conversation