Quartile

Statistics & Probability

Quartiles divide a dataset into four equal parts, with Q1, Q2 (median), and Q3 marking the boundaries.

Definition

Quartiles are three values that split a sorted dataset into four equal groups. Q1 is the boundary below the first 25%, Q2 is the median (50%), and Q3 is the boundary below the top 25%.

Example

Sorted scores: $10$, $20$, $30$, $40$, $50$, $60$, $70$, $80$. $Q_1 = 25$ (boundary between first and second quarter), $Q_2 = 45$ (median), $Q_3 = 65$ (boundary between third and fourth quarter).

Key Insight

Think of quartiles like dividing a line of students into four equal-sized groups by height. $Q_1$, $Q_2$, and $Q_3$ are the three dividing points.

Definition

Quartiles $Q_1$, $Q_2$, $Q_3$ divide an ordered dataset into four equal parts. $Q_2$ is the median. $Q_1$ is the median of the lower half; $Q_3$ is the median of the upper half. Different methods exist for calculating quartiles (inclusive vs. exclusive of the median), which can give slightly different results.

Example

Data: $3$, $5$, $7$, $8$, $9$, $11$, $14$, $16$, $21$. Median ($Q_2$) $= 9$. Lower half: $3$, $5$, $7$, $8$. $Q_1 = (5+7)/2 = 6$. Upper half: $11$, $14$, $16$, $21$. $Q_3 = (14+16)/2 = 15$. $\text{IQR} = 15 - 6 = 9$.

Key Insight

The five-number summary (min, $Q_1$, $Q_2$, $Q_3$, max) captures the shape of a distribution concisely. Together with the IQR, it provides a complete picture of center and spread without being affected by outliers.

Definition

Quartiles are special cases of quantiles: $Q_1 = F^{-1}(0.25)$, $Q_2 = F^{-1}(0.50)$, $Q_3 = F^{-1}(0.75)$. For a finite sample, quantile computation uses interpolation. R implements nine different quantile algorithms (types $1$-$9$); type $7$ (linear interpolation of order statistics) is the default. The sample quantile function converges to the population quantile function as $n$ grows.

Example

For the standard normal distribution, $Q_1 = -0.6745$, $Q_2 = 0$, $Q_3 = 0.6745$. $\text{IQR} = 1.349$. These exact values are used to calibrate robust scale estimators for normal data.

Key Insight

The asymptotic variance of the sample $p$-th quantile $Q_p$ is $p(1-p)/(nf(Q_p)^2)$, where $f$ is the PDF. This shows that quantiles at the extremes ($p$ near $0$ or $1$) are estimated less precisely, explaining why extreme percentiles require much larger samples for reliable estimation.