Facebook Pixel
Mathos AI logo

Box Plots and Interquartile Range

Box Plots and Interquartile Range

A box plot (or box-and-whisker plot) is a visual way to show how a set of data is spread out. Instead of showing every single data point, it divides the data into four equal parts (quartiles) using five key numbers.

The Five-Number Summary

To draw a box plot, you first need to find the five-number summary:

  1. Minimum: The smallest number in the dataset.
  2. First Quartile (Q1Q_1): The median of the lower half of the data.
  3. Median (Q2Q_2): The middle number of the entire dataset.
  4. Third Quartile (Q3Q_3): The median of the upper half of the data.
  5. Maximum: The largest number in the dataset.

Example: Find the five-number summary for the data set: 2,4,6,8,10,12,142, 4, 6, 8, 10, 12, 14.

  • The data is already in order.
  • Median (Q2Q_2): The middle number is 88.
  • Lower half: 2,4,62, 4, 6. The median of this half is Q1=4Q_1 = 4.
  • Upper half: 10,12,1410, 12, 14. The median of this half is Q3=12Q_3 = 12.
  • Minimum: 22
  • Maximum: 1414

Drawing a Box Plot

Once you have your five numbers, you can draw the plot along a number line:

  • Draw a box that starts at Q1Q_1 and ends at Q3Q_3.
  • Draw a vertical line inside the box at the Median (Q2Q_2).
  • Draw lines (called "whiskers") extending from the ends of the box out to the Minimum and Maximum values.

The Interquartile Range (IQR)

The Interquartile Range (IQR) measures the spread of the middle 50%50\% of your data. It is the length of the box in your box plot.

IQR=Q3Q1\text{IQR} = Q_3 - Q_1

Using our previous example: IQR=124=8\text{IQR} = 12 - 4 = 8

Identifying Outliers

An outlier is a data point that is abnormally far away from the rest of the data. We use the IQR to check if a number is an outlier. A number is an outlier if it is:

  • Lower than Q11.5×IQRQ_1 - 1.5 \times \text{IQR}
  • Higher than Q3+1.5×IQRQ_3 + 1.5 \times \text{IQR}

Example: Is 2525 an outlier in our dataset?

  • Calculate the upper boundary: Q3+1.5×IQR=12+1.5×8=12+12=24Q_3 + 1.5 \times \text{IQR} = 12 + 1.5 \times 8 = 12 + 12 = 24.
  • Since 2525 is greater than the upper boundary of 2424, it falls outside the normal range. Therefore, 2525 is an outlier.