BookmarkSubscribeRSS Feed
onimisi_esho
Fluorite | Level 6

Hi, Please I am trying to do a segmentation analysis by grouping customer's into different segments by their revenue. The segments are Top 1%, Next 4%, Next 15%, Next 30% and bottom 50%.

 

Please what is the best approach to this.

 

I thought about using percentiles. 

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

@onimisi_esho hi and welcome to the SAS Community 🙂

 

This can be done in a few different ways. Have you read this?

 

https://blogs.sas.com/content/iml/2019/08/07/essential-guide-binning-sas.html

onimisi_esho
Fluorite | Level 6

hi @PeterClemmensen ,

 

Thanks four response.

 

The quantile binning option seems to be the closest option to my problem. I am relatively new to SAS.

 

My data is on a table and I wish to output my result in the same table.(See Photo) My intended output is in yellow.

 

How will i go about this incorporating the function considering i will be writing an SQL statement. 

 

 

Segment.png

Reeza
Super User
Only by revenue? If so, that's more classification than segmentation as segmentation usually has multiple variables. If you're looking at just one variable and specific percentiles start with PROC RANK and GROUP=100. That will give you the percentile for each value and you can then create your groups as desired.

proc rank data=sashelp.cars out=want groups=100;
var mpg_city;
rank mpg_city_rank;
run;


*see distribution of ranks;
proc freq data=want;
table mpg_city_rank;
run;




This will create the ranking variables and you can then filter - 0 is lowest and 99 is the highest usually.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1232 views
  • 0 likes
  • 3 in conversation