## Programming the statistical procedures from SAS

Frequent Contributor
Posts: 95

Hi,

I have run a Proc univariate on my data, and get the report below, I would like to have the volume that I get for each quantile or percentile (Report below). Your help will be much appreciated.

Many Thanks

 Quantiles (Definition 5) Quantile Estimate 100% Max 0.1039 99% 0.0468 95% 0.0382 90% 0.0341 75% Q3 0.0287 50% Median 0.0237 25% Q1 0.0201 10% 0.0179 5% 0.0169 1% 0.015 0% Min 0.0102
Super User
Posts: 20,731

Frequent Contributor
Posts: 95

The volume in ecah percentile for example 0%, 1%, 5% , 10 % etc...

Posts: 2,054

Hi, I don't understand either. When Reeza asks "What's your question?" and you say

```The volume in ecah percentile for example 0%, 1%, 5% , 10 % etc...
```

This is not a question

Furthermore, you already have shown us the volume in each percentile, as computed by PROC UNIVARIATE, so you have the results. Problem solved, I think.

--
Paige Miller
Frequent Contributor
Posts: 95

Sorry, maybe I didn't explain myself properly, I meant the actual volume...(Frequency)..for example you have first 0%, how many cutomers who fall in ecah percentile? For example when you rank your population into deciles , you will get volume like below, how do I get the volume using proc univariate (The actual number of cistomers)..Hope I make sense Many Thanks

 decile noresponse response Total Volume 9 2,973 639 3,612 8 2,732 424 3,156 7 3,175 407 3,582 6 2,799 355 3,154 5 2,858 330 3,188 4 3,869 442 4,311 3 2,990 318 3,308 2 3,119 330 3,449 1 2,959 285 3,244 0 3,159 272 3,431
Super User
Posts: 20,731

What variable are you using to create your ranks?

I'd assume you'd run proc rank on your data followed by a proc freq to get that type of output, but you still haven't provided enough information.

Primarily what your data looks like, how you're assigning ranks.

Frequent Contributor
Posts: 95

Basically, my data is just probabilities per customer, I wnat to check the distribution of the probabilities.....and the proc univariate gives you the report below, but i will aslo want to see the volume....(actual number of customers who fall in each percentile of quantile)

My raw data

 customer_id Probability 1002 0.05 1003 0.6 1004 0.8 1005 0.02 1006 0.03 1007 0.5 1008 0.6

Desired Output

 Quantiles (Definition 5) Quantile Estimate Volume 100% Max 0.025 ? 99% 0.014 ? 95% 0.0099 ? 90% 0.0074 ? 75% Q3 0.0037 ? 50% Median 0.002 ? 25% Q1 0.0015 ? 10% 0.0012 ? 5% 0.0011 ? 1% 0.0009 ? 0% Min 0.0008 ?
Super User
Posts: 20,731

Defined as how?

Check the definition of percentiles:Percentile - Wikipedia, the free encyclopedia

99% percentile reflects the data point where 99% are less than this number, you seem want to bin the numbers instead.

If you want to bin the numbers use proc rank and then proc freq as indicated.

Frequent Contributor
Posts: 95

Hi Reeza,

So 99% of my population, let's say I have a Million of customers...so it means that 990,000 have a probability less than 0.014 for example...and if I want to know the volume of customers the 1% percentile (data point where 1% is less than 0.0009) , I just run a count(*) on customers who have less than 0.0009 and greater than 0.0008. Am I right? Thank you

 Quantiles (Definition 5) Quantile Estimate Volume 100% Max 0.025 ? 99% 0.014 ? 95% 0.0099 ? 90% 0.0074 ? 75% Q3 0.0037 ? 50% Median 0.002 ? 25% Q1 0.0015 ? 10% 0.0012 ? 5% 0.0011 ? 1% 0.0009 ? 0% Min 0.0008 ?
Super User
Posts: 20,731

What would that represent though? It just tells you how many people have between 0.009 and 0.008?

What's the definition of that metric?

Super User
Posts: 7,259

Isn't it just roughly .99 * your N?

Otherwise output the percentiles from Proc Univariate and use them to bin your variable (?? proc score ??)  or to create a format and run the data again through a PROC FREQ with the new binned value or formatted value.

Frequent Contributor
Posts: 136