IQR Stats- Measuring Data Spread

What Is IQR and Why You Should Care

The Interquartile Range (IQR) tells you where the middle 50% of your data lives. It's the distance between the 25th percentile (Q1) and the 75th percentile (Q3).

Unlike range or standard deviation, IQR ignores outliers completely. That's not a bug—it's the feature. When your data has extreme values, IQR gives you the real story about typical performance.

How to Calculate IQR

Here's the formula:

IQR = Q3 - Q1

That's it. But you need to find Q1 and Q3 first.

Step-by-Step Process

  1. Sort your data from smallest to largest
  2. Find the median (Q2)—this splits your data in half
  3. Find the median of the lower half → Q1
  4. Find the median of the upper half → Q3
  5. Subtract: Q3 minus Q1

Example Calculation

Data set: 2, 4, 6, 8, 10, 12, 14, 16, 18

The middle 50% of values span 10 units.

IQR vs. Other Spread Measures

Here's how IQR stacks up against the alternatives:

Measure Outlier Resistant Uses All Data Ease of Calculation
IQR Yes ✓ No Medium
Standard Deviation No ✗ Yes Medium
Range No ✗ No Easy
Variance No ✗ Yes Hard

Standard deviation gets wrecked by outliers. One extreme value can blow up your entire measure. IQR shrugs it off.

Finding Outliers with IQR

This is where IQR earns its keep. Use it to identify values that don't belong:

Anything below the lower bound or above the upper bound is a potential outlier.

Quick Example

If Q1 = 20, Q3 = 40, and IQR = 20:

Values below -10 or above 70 are outliers. In most real data, negative values don't make sense anyway, so you'd flag anything above 70.

Reading Box Plots

Box plots visualize IQR directly. Here's what you're looking at:

📊 The box IS the IQR. The longer the box, the more spread in your middle data.

When to Use IQR

IQR works best when:

IQR is the standard choice in exploratory data analysis. It's robust, which means your conclusions hold up even when data misbehaves.

Common Mistakes to Avoid

Practical Applications

You'll see IQR used in:

How to Get Started

You can calculate IQR manually, or use built-in functions:

Pick your tool and start. For small datasets, do it by hand once so you understand what the software is doing.

The Bottom Line

IQR tells you about typical spread, not total spread. It's resistant to outliers, easy to calculate, and works with any dataset that can be ordered.

Use it when you want honest answers about where your data actually lives—not distorted by extremes.