The HPBIN Procedure

Computing the Quantiles (Percentiles)

PROC HPBIN computes the 0% (minimum), 1%, 5%, 10%, 25%, 50%, 75%, 90%, 95%, 99%, and 100% (maximum) percentiles of each binning variable.

Let $m$ be the number of nonmissing values for a variable, and let $x_1$, $x_2$, ..., $x_ m$ represent the ordered values of the variable. Let the $t$th percentile be $y$, set $p = \frac{t}{100}$, and let $mp$ = $j$ + $g$, where $j$ is the integer part of $mp$ and $g$ is the fractional part of $mp$. Then the $t$th percentile is as described as:

\[  y = \begin{cases}  x_ j &  \text { if } g = 0 \\ x_{j+1} &  \text { if } g > 0 \end{cases}  \]

Note: To avoid the time-consuming sorting process, the HPBIN procedure uses an iterative projection method to compute percentiles according to the preceding formula.