Interquartile Range (IQR) Calculator

Data Visualization

Interquartile Range (IQR) Calculator

What is the Interquartile Range (IQR)?

The Interquartile Range (IQR) is a measure of statistical dispersion, which represents the spread of the middle 50% of a dataset. It is calculated as the difference between the third quartile (Q3) and the first quartile (Q1) of a dataset.

Formula and Its Meaning

The formula for IQR is:

\[IQR = Q3 - Q1\]

Where:

  • Q1 is the first quartile (25th percentile)
  • Q3 is the third quartile (75th percentile)

The IQR represents the range within which the middle 50% of the data falls, making it resistant to outliers and a robust measure of spread.

Calculation Steps

  1. Sort the dataset in ascending order.
  2. Find Q1 (the median of the lower half of the data).
  3. Find Q3 (the median of the upper half of the data).
  4. Calculate IQR by subtracting Q1 from Q3.

Example Calculation

Let's calculate the IQR for the dataset: 2, 3, 4, 5, 6, 7, 8, 9

  1. The data is already sorted.
  2. Q1 = median of (2, 3, 4, 5) = 3.5
  3. Q3 = median of (6, 7, 8, 9) = 7.5
  4. IQR = Q3 - Q1 = 7.5 - 3.5 = 4

Visual Representation

IQR Visualization for Dataset: 2, 3, 4, 5, 6, 7, 8, 9 Q1 (3.5) Median (5.5) Q3 (7.5) 2 3 4 5 6 7 8 9 IQR = Q3 - Q1 = 7.5 - 3.5 = 4

This box plot represents the example dataset. The box represents the IQR, with Q1, median, and Q3 marked. The whiskers extend to the minimum and maximum values.