Percentile Definitions
You can use the PCTLDEF= option to specify one of five definitions for
computing quantile statistics (percentiles). Suppose that n equals
the number of nonmissing values for a variable and that x1, x2, ... ,xn represents the ordered values of the analysis
variable. For the tth percentile, set p =t/100.
For the following definitions numbered 1, 2, 3, and 5, express np as
-
np = j + g
where j is the integer part of np, and g is the
fractional part of np. For definition 4, let
-
(n+1)p=j+g
The tth percentile (call it y) can be defined as follows:
- PCTLDEF=1
- weighted average at xnp
-
y = (1 - g)xj + gxj+1
where x0 is taken to be x1
- PCTLDEF=2
- observation numbered closest to np
-
y = xi
where i is the integer part of np + 1/2
if . If g=1/2, then
y=xj if j is even, or
y=xj+1 if j is odd.
- PCTLDEF=3
- empirical distribution function
-
y = xj if g = 0
-
y = xj+1 if g > 0
- PCTLDEF=4
- weighted average aimed at xp(n+1)
-
y=(1 - g)xj + gxj+1
where xn+1 is taken to be xn
- PCTLDEF=5
- empirical distribution function with averaging
-
y = (xj + xj+1)/2 if g = 0
-
y = xj+1 if g > 0
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.