Statistics Quest

Quantiles, percentiles and quartiles

The p-th quantile is a value with about a proportion p of the data below it; software differs in how it interpolates, and Statistics Quest uses Hyndman–Fan type 7 by default.

Q(p)=x(j)+g (x(j+1)−x(j)),h=(n−1)p+1, j=⌊h⌋, g=h−jQ(p) = x_{(j)} + g\,\bigl(x_{(j+1)} - x_{(j)}\bigr), \quad h = (n-1)p + 1,\ j = \lfloor h \rfloor,\ g = h - j
Type 7 (default; R, NumPy, Excel PERCENTILE.INC / QUARTILE.INC).
pp
Probability between 0 and 1 (the 90th percentile is p=0.9p = 0.9).
x(j)x_{(j)}
The jj-th smallest value.
hh
Position in the sorted data; jj is its whole part, gg its fractional part.
h=(n+1)ph = (n+1)p
Type 6 (Excel PERCENTILE.EXC / QUARTILE.EXC, Minitab): same interpolation, different position.
hh
Position; values beyond the ends are clamped to the minimum or maximum.
IQR=Q3−Q1=Q(0.75)−Q(0.25)\text{IQR} = Q_3 - Q_1 = Q(0.75) - Q(0.25)
Interquartile range.
Q1, Q3Q_1,\ Q_3
First and third quartiles.

When to use

  • Describing position ("the 90th percentile of delivery time is 41 minutes"), spread (IQR), pay bands, risk quantiles (VaR-style).
  • Comparing distributions with different shapes; quantiles do not assume symmetry.
  • The engine offers all nine Hyndman–Fan types because software disagrees; state the type when the exact number matters.

How to interpret

Q1Q_1, the median and Q3Q_3 split the sorted data into four parts with about 25% each. The IQR is the spread of the middle half and is not affected by the most extreme quarter on each side. A percentile rank is the reverse question: what percentage of values lie below a given value?

Common mistakes

  • Expecting identical quartiles from every program: with small samples type 6 and type 7 can differ noticeably. Neither is "wrong".
  • Computing quantiles of unsorted data.
  • Confusing a percentile (a value in data units) with a percentage.

Example

Data 7, 15, 36, 39, 40, 41 (n=6n = 6). Type 7: Q1=20.25Q_1 = 20.25, median 37.5, Q3=39.75Q_3 = 39.75, IQR = 19.5, 90th percentile 40.5. Type 6 (Excel .EXC): Q1=13Q_1 = 13, Q3=40.25Q_3 = 40.25, 90th percentile 41. Same data, different conventions.