The interquartile range (IQR) measures the spread of the middle 50% of a dataset, calculated as Q3 minus Q1. It's robust against outliers, making it useful in statistics for summarizing variability.

Step-by-Step Calculation

Sort your data in ascending order first. Then find the median (Q2), which splits the data into lower and upper halves.

  1. Locate Q1 : Median of the lower half (25th percentile). For even counts, average the two middle values; exclude or include the overall median based on method (exclusive vs. inclusive).
  1. Locate Q3 : Median of the upper half (75th percentile), using the same approach.
  1. Compute IQR : Subtract Q1 from Q3, so IQR = Q3 - Q1.

Example Dataset : 1, 3, 5, 7, 9, 11, 13 (7 values, odd).

  • Median (Q2): 7 (4th position).
  • Lower half: 1, 3, 5 → Q1 = 3.
  • Upper half: 9, 11, 13 → Q3 = 11.
  • IQR = 11 - 3 = 8.

For even datasets like 2, 4, 6, 8, 10, 12 (exclusive method splits evenly).

Methods Compared

Two common approaches differ slightly for small datasets:

Method| Q1/Q3 Handling| Best For| Example IQR (dataset: 1-10)
---|---|---|---
Exclusive| Excludes median from halves| Even sample sizes| 24 1
Inclusive| Includes median in both halves| Odd sample sizes| 20 1

Why Use IQR?

  • Ignores extremes, unlike full range. Picture data as a box plot: IQR is the box's height.
  • Detect outliers: Values beyond 1.5 × IQR from Q1/Q3.
  • Real-world: In quality control (2024 guides note its rise in data analytics tools).

Tools and Tips

Use calculators for speed—input sorted data for instant Q1, Q3, IQR. Excel: =QUARTILE.INC(A1:A10,1) for Q1. Python (numpy): iqr = np.percentile(data, 75) - np.percentile(data, 25). Always verify with hand calc for learning.

TL;DR : Sort data, find Q1 (median lower half), Q3 (upper), IQR = Q3 - Q1. Simple, outlier-proof stat.

Information gathered from public forums or data available on the internet and portrayed here.