turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- Proc Univariate and the 90th Percentile

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-07-2016 11:58 AM

Hello All,

I have some questions, regarding percentiles in proc univariate. I am able to calculate the percentiles from 50 to 100 by 5 using the below output statement.

output pctlpre=P_ pctlpts=50 to 100 by 5 ;

When doing so I get the 80-100th percentile equal a success rate of 100. Does this mean that any one with a success rate of 100 belongs in all of these percentiles? Also, is there a way that I can have sas create a data set for me with a column indicateing what percentile everyone belongs in?

ID | SR | Pct |

1 | 100 | 100 |

2 | 82 | 50 |

3 | 97 | 70 |

How would that work with 80-100 being equal?

Thanks for your help.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to BStats

07-07-2016 12:58 PM

It probably reflects either the number of responses or the number of unique responses in your data.

If you only have 5 response for instance, 1,2,3,4,5 then the Value 5 would have percentiles from 85 to 100.

You may need to clarify exactly what you mean for percentile if you have fewer than 100 responses to work with as in that case you will have multiple integer percentiles (1, 2, 3, ...,98,99) possible for the same value.

One way would be to use PROC Rank with groups = 100 for your numeric variable

proc rank data=have out=want groups=100;

var variablename;

ranks variablenamerank;

run;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ballardw

07-07-2016 01:05 PM

I have over 250 observation with 20 unique success rates.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to BStats

07-07-2016 03:55 PM

If you have 20 unique values then each one will represent a percentile group of 5% roughly.

This depends a bit on how you define your percentiles. Look at the PCTLDEF option in Proc Univariate to see your options