New Contributor
Posts: 2

# Segmentation

HI,

I am a student learning SAS, I am struggling to do the coading for below questions, I am wondering if anyone can help please?

Segment the customer base by customer revenue to compare the characteristics of the customers with the highest revenue to the rest of the customers. A standard way of doing the above is to compare the characteristic of the top 25% of customers to the bottom 75% on the basis of customer revenue.
 Examine and describe the customers in the top 25% of customer revenue using their demographics details as this will provide additional insights on who to target for the forthcoming marketing campaign in which the business would be looking to purchase a new prospect list.

Super Contributor
Posts: 326

## Re: Segmentation

One way is to sort the data by the revenue in descending order. You can use the first 25 per cent of the observations. Use their IDs and go into their characteristics of interest for exploration.

Super User
Posts: 13,583

## Re: Segmentation

A number of procedures would give you the quartile values for your (assuming a single) revenue variable: Procs Univariate, Means or Summary with the Q1 or P25 statistic requested.

Add a variable back into your data to indicate whether a customer's revenue is at or above (top 25%) or below that value (bottom 75%).

You can then run reports or tests using that segmentation variable to create comparisons such as using it in a CLASS statement in Proc Means or Summary, or a crossing variable in a Tables statement for Proc Freq, or as a categorical variable in modeling procedures.

New Contributor
Posts: 2

## Re: Segmentation

Hi,

Thank you for getting back to me,

I am still confuse with it as you can understand I am a student and trying to learn.

Honestly, I learn more through example, is there any chance you can provide me example with the coding so I can understand how its working out?

Regards

Super User
Posts: 13,583

## Re: Segmentation

Provide some example data to work with as datastep code.

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

has an example of creating datastep from a dataset.

Super User
Posts: 5,884

## Re: Segmentation

It seems to my that you are learning from scratch. Unfortunately this forum us Nog the appropriate place for that.
There are free online SAS Programming training, I suggest that you start with that.
Data never sleeps
Discussion stats
• 5 replies
• 427 views
• 0 likes
• 4 in conversation