PERCENTILE inputDataVector inputPercentVector resultVariable

Replaces the contents of the result variable with the list of values that are the percentiles from the input data vector that are requested in the input percent vector.

The values you enter should be percents between 0 and 100 (0 and 100 are not allowed), not decimal fractions between 0.0 and 1.0

Missing numbers (represented by NaN or ".") are ignored in computing the percentile.

The PERCENTILE command first sorts the input vector's values, then calculates the value corresponding to a specified percentile x of a distribution. If there is a single value y such that the percentage of the distribution below y is less than x and the percentage of the distribution above y is less than (1-x), that value y is the percentile sought. If the specified percentile does not correspond exactly to a single position in the distribution of values, an average of the values bracketing the percentile position will be used. This procedure is analogous to the method for calculating the median.

NUMBERS 1,10 A
PERCENTILE A (10 50 75) percentiles
PRINT A percentiles

The above program produces the following output:

A: (1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0)
percentiles: (1.5 5.5 8.0)