Monday, December 18, 2006

Calculating percentiles in SAS

Following code can be used to find the percentiles.

proc univariate data=food noprint;
var omega sat;
output out=pctl pctlpts=20 40 60 80 pctlpre=omega sat;
run;
proc print data=pctl;
run;


Output would be in the following format
omega20 omega40 omega60 omega80 sat20 sat40 sat60 sat80

(from http://www.ats.ucla.edu/STAT/sas/faq/percentiles.htm)