SAS Enterprise Guide

Desktop productivity for business analysts and programmers
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.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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