Box Plot

Statistics & Probability

A box plot summarizes a dataset using five key values: minimum, Q1, median, Q3, and maximum, displayed as a box with whiskers.

Definition

A box plot (also called a box-and-whisker plot) shows the spread of data using a box and two lines called whiskers. The box covers the middle half of the data, and the line inside the box marks the median.

Example

For test scores, the box might stretch from $70$ to $90$ (the middle $50\%$), with the median line at $80$. The whiskers extend to the lowest score ($55$) and highest score ($100$).

Key Insight

A box plot gives you a quick summary of a dataset: where the center is (median), how spread out the middle half is (the box), and how far the extremes extend (the whiskers).

Definition

A box plot displays the five-number summary: minimum, $Q_1$ ($25$th percentile), median ($Q_2$, $50$th percentile), $Q_3$ ($75$th percentile), and maximum. The box spans $Q_1$ to $Q_3$ (the IQR). Whiskers extend to the most extreme values within $1.5 \times \text{IQR}$ from the quartiles; values beyond this are plotted as individual outlier points.

Example

Five-number summary for a dataset: $\text{min}=40$, $Q_1=60$, $\text{median}=72$, $Q_3=85$, $\text{max}=95$. $\text{IQR}=25$. Fence for outliers: lower $= 60 - 1.5(25) = 22.5$, upper $= 85 + 1.5(25) = 122.5$. No values fall outside these fences.

Key Insight

Box plots are especially useful for comparing multiple groups side by side. When the median lines of two groups do not overlap the boxes, the groups are likely significantly different.

Definition

The box plot's outlier rule (flag values beyond $Q_1 - 1.5 \cdot \text{IQR}$ or $Q_3 + 1.5 \cdot \text{IQR}$) corresponds approximately to the range of a normal distribution within about $2.7$ standard deviations of the mean, flagging roughly $0.7\%$ of normally distributed values as outliers. For skewed data, the box plot's asymmetry reveals the skew direction.

Example

Comparing box plots of salary distributions across departments: a right-skewed box plot (longer upper whisker and outlier dots on the right) indicates a small number of very high earners pulling the mean above the median.

Key Insight

The violin plot is a modern alternative that replaces the box with a kernel density estimate, preserving the five-number summary information while showing the full distributional shape, including multimodality.