25  Quantile

You are a genius!

Social media posts often feature puzzles claiming that solving them proves genius status or indicates that 99% of people cannot solve the problem. These claims are designed to suggest that solving the puzzle means an individual belongs to an exclusive, intellectual elite group.

While the specific percentages in these viral posts are usually fabricated to grab attention, an underlying statistical principle forms the basis of such claims.

Determining that 99% of people cannot solve a problem—or equivalently, that only 1% can—relies on relative position within a distribution. For instance: if 1,000 people attempt a problem and only 10 succeed, the success rate is 1%, placing those who solve it in the top 1%. Another approach implicitly links the puzzle-solving ability to a continuous quantitative ability (Chapter 17), such as IQ. Under this model, the top 1% corresponds to individuals whose IQ scores place them in the highest 1% of the distribution.

More generally, values can be ordered from smallest to largest to evaluate relative ranking. For any point in an ordered dataset, the proportion of values falling above or below that point can be calculated. A quantile identifies the specific value that splits a distribution into such given proportion. The median (Chapter 24) is a special case of quantile (0.5 quantile), where half of the observations fall below the value and half fall above.

Formal

The concept of a quantile generalizes the median. While the median splits a distribution into two equal halves (the 0.50 quantile), quantiles divide an ordered dataset or a probability distribution into arbitrary proportions \(p \in (0, 1)\).

Quantiles can be defined empirically using ordered data or using cumulative distribution.

In descriptive statistics, the \(p\)-quantile (often expressed as a percentile when multiplied by 100) is a value that separates the lowest fraction \(p\) of the ordered data from the remaining fraction \(1 - p\).

Consider a sample of \(n\) observations ordered in non-decreasing sequence:

\[x_{(1)} \le x_{(2)} \le \dots \le x_{(n)}\]

To locate the \(p\)-quantile, first determine the position index \(L_p\):

\[L_p = p(n + 1)\]

If \(L_p\) is an integer, the \(p\)-quantile corresponds directly to \(x_{(L_p)}\). If \(L_p\) is not an integer, linear interpolation is applied between the adjacent ordered values \(x_{(\lfloor L_p \rfloor)}\) and \(x_{(\lceil L_p \rceil)}\).

  • Quartiles are specific quantiles that divide an ordered dataset into four equal parts:

    • The first quartile (\(Q_1\), or 0.25 quantile) separates the lowest 25% of the data from the upper 75%.
    • The second quartile (\(Q_2\), or 0.50 quantile) corresponds to the sample median, dividing the dataset into two equal halves.
    • The third quartile (\(Q_3\), or 0.75 quantile) separates the lowest 75% of the data from the upper 25%.
  • The interquartile range (\(\text{IQR}\)) measures statistical dispersion by evaluating the spread of the middle 50% of the dataset. It is calculated as the difference between the third and first quartiles:

\[\text{IQR} = Q_3 - Q_1\]

Examples

  • Consider a dataset containing 100 observations formed by two distinct clusters: the integers from 1 to 50 and the integers from 1001 to 1050.

    The \(1\%\), \(2\%\), and \(3\%\) quantiles (\(0.01\), \(0.02\), and \(0.03\) quantiles) correspond to 1, 2, and 3, respectively. Similarly, the \(20\%\) quantile is 20.

    The median (\(0.50\) quantile) falls directly between the two clusters:

    \[\text{Median} = \frac{50 + 1001}{2} = 525.5\]

    The \(51\%\) quantile steps into the second cluster at 1001, while the \(98\%\) and \(99\%\) quantiles correspond to 1048 and 1049.

  • Visualizing quantiles within a distribution helps to illustrate how cutoffs map directly to specific proportions of data.

    1. In a histogram (Chapter 19), a quantile represents the boundary value along the x-axis below which a specified percentage of total observations falls. For instance, the value corresponding to the 8% quantile divides the lowest 8% of the data (green region) from the upper 92%. Similarly, the 75% quantile—also known as the third quartile (Q3)—marks the boundary below which 75% of the observations lie.

    1. The quantile can be easily inferred with a cumulative distribution (Chapter 20). (1) Pick the quantile percentage on the y-axis, (2)project a horizontal line (e.g., 8% or 75%) to where it intersects the cumulative curve, and then (3) drop a vertical line to the x-axis, which is the corresponding quantile value.

Tips and warnings

  • The quantile is a pair: the proprtion \(p\) and the respective \(x\) value.

  • The interquartile range (\(\text{IQR}\)) measures the spread of the middle 50% of a distribution, calculated as the difference between the 75% and 25% quantiles (\(Q_3 - Q_1\)). The rectangles in a default boxplot represent the IQR and is a measure dispersion (alternative to the standard devitation).

  • Quantile estimates can become imprecise or unstable in small datasets. In such cases, linear interpolation or theoretical approximations may yield unreliable results.

  • A \(p\)-value of 0.06 is directly related to a 0.06 (0.94 or 0.03-0.97) quantile of the null distribution1. Using the IQ metaphor from the introduction, this corresponds to three possible interpretations: an IQ in the top 6%, in the bottom 6%, or split between the top 3% and bottom 3%. The first two interpretations describe one-sided statistics, whereas the last applies to a two-sided statistic.

Notation/Semantic/Terminology

  • Percentiles and quantiles describe identical statistical cutoffs. Mathematically, the \(p\)-quantile corresponds directly to the \((100 \times p)\)-th percentile. For example, the 0.50 quantile, the 50th percentile, and the median (\(Q_2\)) refer to the exact same value in a dataset.

  1. explained in the next version↩︎