The keywords for quantiles and
related statistics are
is the lower quartile
(25th percentile).
is the upper quartile
(75th percentile).
is interquartile range
and is calculated as
You use the QNTLDEF= option (PCTLDEF= in PROC UNIVARIATE)
to specify the method that the procedure uses to compute percentiles.
Let

be the number of nonmissing values for a variable,
and let

represent the ordered values of the variable such
that

is the smallest value,

is next smallest value, and

is the largest value. For the
tth percentile between 0 and 1, let

. Then define

as the integer part of

and

as the fractional part of

or

, so that
Here, QNTLDEF= specifies
the method that the procedure uses to compute the
tth percentile, as shown in the table that follows.
When you use the WEIGHT
statement, the
tth percentile
is computed as
where

is the weight associated with

and

is the sum of the weights. When the observations
have identical weights, the weighted percentiles are the same as the
unweighted percentiles with QNTLDEF=5.
Methods for Computing Quantile Statistics
|
|
|
|
weighted average at

|
|
|
where  is taken to be 
|
|
observation numbered
closest to 
|
|
if 
|
|
if  and  is even
|
|
if  and  is odd
|
where i is the integer part of 
|
|
empirical distribution
function
|
|
if 
|
|
if 
|
|
weighted average aimed
at 
|
|
|
where  is taken to be 
|
|
empirical distribution
function with averaging
|
|
if 
|
|
if 
|