BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sasmaverick
Obsidian | Level 7

Hello,

 

I have a 10,000 records data set. Using z-score I need to select and flag the records as follows:

 

1. Top 15% high $$ customers (z-score of the dollar_amt variable greater than +1)

2. Bottom 15% low $$ customers (z-score of the dollar_amt variable less than -1).

 

I need to know if there is a way to do this in SAS and how.

 

Regards,

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Yes, Proc stdize will create Z scores or you can manually calculate this via a data step or proc SQL step. 

View solution in original post

2 REPLIES 2
Reeza
Super User

Yes, Proc stdize will create Z scores or you can manually calculate this via a data step or proc SQL step. 

sasmaverick
Obsidian | Level 7

Hi Reeza,

 

Below is the code I am using

 

proc standard data=sample mean=0 std=1 out=sample_out;

var amount transaction;

run;

 

Would this give me the top 15% customer if I put the condition "amount>1" and bottom 15% if I put "amount<-1". This is the score calculated from the above step for amount. I see some conditions are not fulfilled and I get 0 observations. For example if I put transaction<-1

 

Thanks

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 ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 15224 views
  • 2 likes
  • 2 in conversation