Solved
Contributor
Posts: 69

# Calculate Z Score

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,

Accepted Solutions
Solution
‎07-05-2017 11:33 AM
Super User
Posts: 20,731

## Re: Calculate Z Score

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

All Replies
Solution
‎07-05-2017 11:33 AM
Super User
Posts: 20,731

## Re: Calculate Z Score

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

Contributor
Posts: 69

## Re: Calculate Z Score

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

☑ This topic is solved.