Sure, use the CDF option to get the cumulative density estimate. The 100*p_th percentile is the smallest value such that the CDF is greater than or equal to p.
There are various ways to get a list of percentiles from the CDF. Here is one way:
/* sample data */
data heart;
set sashelp.heart; where sex="Female";
run;
/* use the CDF option, which creates the 'Distribution' variable */
proc kde data=heart;
univar cholesterol / CDF METHOD=SJPI out=density;
run;
/* The 100*p_th percentile is the smallest data value for which the CDF exceeds p */
data Pctls;
array MyPctls[8] _temporary_ (0.05 0.1 0.25 0.5 0.75 0.9 0.95 1.0); /* end array with 1.0 */
retain k 1;
set density;
Pctl = MyPctls[k];
if distribution >= Pctl then do;
output;
k + 1;
end;
drop k;
run;
proc print data=Pctls;
var PCtl Var Value Distribution;
run;
... View more