To compute the pth quantile of n non-missing values in a column, arrange the n values in ascending order and call these column values y1, y2, ..., yn. Compute the rank number for the pth quantile as p / 100(n + 1).
•
|
If the result is an integer, the pth quantile is that rank’s corresponding value.
|
•
|
If the result is not an integer, the pth quantile is found by interpolation. The pth quantile, denoted qp, is computed as follows:
|
–
|
n is the number of non-missing values for a variable
|
–
|
–
|
–
|
–
|
The value y12 is the 75th quantile. The 90th quantile is interpolated by computing a weighted average of the 14th and 15th ranked values as y90 = 0.6y14 + 0.4y15.