Hi all,
i have 3 variables.
Los index is length of stay
Hospital Los Index Mortality Index
A 1.12 1.28
B 0.14 0.94
For Hundreds of records like this...
I want to calculate percentiles 10,20 ,25, 30,40,50,60,75,80,90, and 100 th for this data in SAS
And the ranks of the hospitals
Could somebody help me please..........
Thanks a lot
PROC UNIVARIATE and PROC SUMMARY will both get the percentiles for these. PROC RANK will do the ranks.
Hi Doc,
I first use proc univariate on the Los index variable.I will output the percentiles to another dataset,
To the output dataset when i use rank on the same variable i get rankalso in my final dataset.is that right?????
Thanks a lot
no. run PROC RANK directly against the raw data.
SO DO U WANT ME TO RUN THIS CODE AND IT WILL GIVE PERCENTILES AS WELL AS RANKS FOR BOTH OF THESE VARIABLES????????
proc rank data=DSETNAME groups=100 out=ranked_a;
var LOS_INDEX MORTALITY_INDEX;
ranks rank_y;
run;
Thanks
That will provide "percentile ranks"; it will not provide ranks as they are normally thought of (sequential number from 1 to <samples size>).
Because i wanted 10,20 ,25, 30,40,50,60,75,80,90, and 100 th percentiles
as well as the ranks of each
I understand that. PROC RANKS, as you wrote it, will not provide the ranks, it will provide 'percentile ranks' and they are a bit different. In order to get both the specified percentiles and the ranks, you need to run two procedures.
Great........
Thank you so very much Doc. I appreciate your time on this. Do you also work tomorow?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.