Interquartile Range (IQR): The difference between the third quartile (Q3) and the first quartile (Q1). It represents the range of the middle 50% of the data.
Quartiles: Values that divide the ordered dataset into four equal parts.
Q1 (First Quartile): The median of the lower half of the data.
Q3 (Third Quartile): The median of the upper half of the data.
- Sort the data in ascending order
- Find the median of the entire dataset
- Find Q1 (median of lower half)
- Find Q3 (median of upper half)
- Calculate IQR = Q3 - Q1
Dataset: 12, 15, 18, 20, 22, 25, 28, 30, 35, 40 (already sorted)
Total values: n = 10
n = 10 (even number)
Median = Average of 5th and 6th values = (22 + 25) ÷ 2 = 23.5
Lower half: 12, 15, 18, 20, 22 (first 5 values)
Q1 = Median of lower half = 18 (3rd value)
Upper half: 25, 28, 30, 35, 40 (last 5 values)
Q3 = Median of upper half = 30 (3rd value)
IQR = Q3 - Q1 = 30 - 18 = 12
18
30
12
Q1: 18
Q3: 30
IQR: 12
Interpretation: The middle 50% of values range from 18 to 30.
• IQR formula: IQR = Q3 - Q1
• Quartile positions: Q1 at 25%, Q3 at 75% of sorted data
• Median division: Separates data into lower and upper halves
Odd number of values: When n is odd, the median is included in both halves when finding Q1 and Q3.
Median exclusion: In some methods, the median is excluded from both halves.
Dataset: 5, 8, 10, 12, 15, 18, 20, 22, 25 (already sorted)
Total values: n = 9 (odd)
n = 9 (odd number)
Median = 5th value = 15
Lower half: 5, 8, 10, 12 (values below median)
Q1 = Median of lower half = Average of 2nd and 3rd values = (8 + 10) ÷ 2 = 9
Upper half: 18, 20, 22, 25 (values above median)
Q3 = Median of upper half = Average of 2nd and 3rd values = (20 + 22) ÷ 2 = 21
IQR = Q3 - Q1 = 21 - 9 = 12
Q1 = 9 (25th percentile)
Q3 = 21 (75th percentile)
IQR = 12 (50% of data falls within this range)
9
21
12
Q1: 9
Q3: 21
IQR: 12
Interpretation: The middle 50% of values range from 9 to 21.
• Odd n rule: Exclude median when finding Q1 and Q3
• Quartile calculation: Use same method as median for halves
• IQR consistency: Formula remains IQR = Q3 - Q1 regardless of n
1.5×IQR rule: Values below Q1 - 1.5×IQR or above Q3 + 1.5×IQR are considered outliers.
Outlier boundaries: Lower boundary and upper boundary define the acceptable range.
- Calculate Q1, Q3, and IQR
- Calculate lower boundary = Q1 - 1.5×IQR
- Calculate upper boundary = Q3 + 1.5×IQR
- Identify values outside these boundaries
From Exercise 1: Q1 = 18, Q3 = 30, IQR = 12
Lower boundary = Q1 - 1.5×IQR
Lower boundary = 18 - 1.5×12 = 18 - 18 = 0
Upper boundary = Q3 + 1.5×IQR
Upper boundary = 30 + 1.5×12 = 30 + 18 = 48
Dataset: 12, 15, 18, 20, 22, 25, 28, 30, 35, 40
All values are between 0 and 48
No values are below 0 or above 48
Since all values are within the range [0, 48], there are no outliers in this dataset.
Lower Boundary: 0
Upper Boundary: 48
No outliers detected
Lower boundary: 0
Upper boundary: 48
Outliers: None
Conclusion: All data points are within the acceptable range.
• Outlier boundaries: Q1 - 1.5×IQR and Q3 + 1.5×IQR
• Outlier definition: Values beyond these boundaries
• Systematic detection: Standard method for identifying outliers
Interquartile Range (IQR): The difference between the third quartile (Q3) and the first quartile (Q1), representing the range of the middle 50% of the data.
Quartiles: Three values that divide the ordered dataset into four equal parts, each containing 25% of the data.
Q1 (First Quartile): The median of the lower half of the dataset, also known as the 25th percentile.
Q3 (Third Quartile): The median of the upper half of the dataset, also known as the 75th percentile.
Outliers: Data points that fall significantly outside the overall pattern of the data, typically defined using the 1.5×IQR rule.
- Data sorting: Arrange all values in ascending order
- Median identification: Find the middle value of the dataset
- Q1 calculation: Find median of lower half (values below overall median)
- Q3 calculation: Find median of upper half (values above overall median)
- IQR calculation: Subtract Q1 from Q3
- Outlier detection: Apply 1.5×IQR rule if needed
• IQR formula: IQR = Q3 - Q1
• Outlier boundaries: Lower = Q1 - 1.5×IQR, Upper = Q3 + 1.5×IQR
• Quartile positions: Q1 at 25%, Q3 at 75% of sorted data
• Even n: Median = average of two middle values
• Odd n: Median = middle value
Dataset A: 10, 12, 15, 18, 20, 22, 25, 28, 30
Dataset B: 15, 18, 20, 22, 25, 27, 30, 35, 40
Comparing IQRs: A larger IQR indicates greater variability in the middle 50% of the data.
Relative spread: IQR provides a standardized way to compare variability across datasets.
Dataset A: 10, 12, 15, 18, 20, 22, 25, 28, 30
Median = 20 (5th value)
Lower half: 10, 12, 15, 18 → Q1 = (12 + 15) ÷ 2 = 13.5
Upper half: 22, 25, 28, 30 → Q3 = (25 + 28) ÷ 2 = 26.5
IQR_A = 26.5 - 13.5 = 13
Dataset B: 15, 18, 20, 22, 25, 27, 30, 35, 40
Median = 25 (5th value)
Lower half: 15, 18, 20, 22 → Q1 = (18 + 20) ÷ 2 = 19
Upper half: 27, 30, 35, 40 → Q3 = (30 + 35) ÷ 2 = 32.5
IQR_B = 32.5 - 19 = 13.5
IQR_A = 13
IQR_B = 13.5
Dataset B has a slightly larger IQR (by 0.5 units)
Dataset B has slightly more variability in the middle 50% of its data
Both datasets have similar spread, but Dataset B is slightly more dispersed
13
13.5
0.5
Dataset A IQR: 13
Dataset B IQR: 13.5
Comparison: Dataset B has slightly more variability in the middle 50% of data.
• Spread comparison: Larger IQR indicates greater variability
• Standardized measure: IQR allows fair comparison across datasets
• Robust comparison: IQR is not affected by extreme values
Real-world context: Understanding how IQR can identify unusual patterns in business data.
Management implications: Outliers may indicate special circumstances requiring investigation.
Dataset: $1200, $1300, $1400, $1500, $1600, $1700, $1800, $1900, $2000, $2100, $5000
Total values: n = 11 (odd)
n = 11 (odd)
Median = 6th value = $1700
Lower half: $1200, $1300, $1400, $1500, $1600
Q1 = Median of lower half = $1400 (3rd value)
Upper half: $1800, $1900, $2000, $2100, $5000
Q3 = Median of upper half = $2000 (3rd value)
IQR = Q3 - Q1 = $2000 - $1400 = $600
Lower boundary = Q1 - 1.5×IQR = $1400 - 1.5×$600 = $1400 - $900 = $500
Upper boundary = Q3 + 1.5×IQR = $2000 + 1.5×$600 = $2000 + $900 = $2900
Check highest value: $5000 > $2900 → This is an outlier
The $5000 sale is significantly higher than typical daily sales
This may indicate a special event, seasonal factor, or exceptional performance
Management should investigate to understand the cause
Lower Boundary: $500
Upper Boundary: $2900
Outlier detected: $5000
Q1: $1400
Q3: $2000
IQR: $600
Outliers: $5000 is an outlier
Management insight: The $5000 sale is significantly above normal daily sales and warrants investigation.
• Outlier detection: Systematic approach using 1.5×IQR rule
• Business relevance: Outliers may indicate special opportunities or problems
• Decision making: IQR helps identify data points requiring attention
Interquartile Range (IQR): A measure of statistical dispersion that represents the range between the first quartile (25th percentile) and the third quartile (75th percentile). It captures the middle 50% of the data.
Quartiles: Three values (Q1, Q2, Q3) that divide a ranked dataset into four equal parts, each containing 25% of the observations.
Q1 (First Quartile): The value below which 25% of the data falls; the median of the lower half of the dataset.
Q3 (Third Quartile): The value below which 75% of the data falls; the median of the upper half of the dataset.
Outlier Detection: Using IQR to identify data points that fall significantly outside the normal range of the dataset.
- Data preparation: Sort all values in ascending order
- Median identification: Find the middle value of the entire dataset
- Half dataset creation: Divide data into lower and upper halves
- Q1 calculation: Find median of lower half
- Q3 calculation: Find median of upper half
- IQR calculation: Subtract Q1 from Q3
- Outlier detection: Apply 1.5×IQR rule if needed
• IQR formula: IQR = Q3 - Q1
• Outlier boundaries: Lower = Q1 - 1.5×IQR, Upper = Q3 + 1.5×IQR
• Quartile positions: Q1 at 25%, Q2 at 50%, Q3 at 75% of sorted data
• Even n rule: Median = average of two middle values
• Odd n rule: Median = middle value
Interquartile Range (IQR): A robust measure of statistical dispersion that represents the difference between the 75th percentile (Q3) and the 25th percentile (Q1). It captures the range of the middle 50% of the data, making it resistant to extreme values.
Quartiles: Three values that divide an ordered dataset into four equal parts. Q1 (first quartile) is the median of the lower half, Q2 (second quartile) is the overall median, and Q3 (third quartile) is the median of the upper half.
Robust Statistics: Statistical measures that are not significantly affected by outliers or extreme values. IQR is a robust measure of spread because it only considers the middle 50% of the data.
Outlier Detection: The systematic process of identifying data points that deviate significantly from the overall pattern of the dataset using statistical criteria.
- Data organization: Sort all values in ascending order
- Median determination: Find the middle value of the dataset
- Dataset division: Split data into lower and upper halves
- Q1 calculation: Find the median of the lower half
- Q3 calculation: Find the median of the upper half
- IQR computation: Calculate IQR = Q3 - Q1
- Outlier analysis: Apply 1.5×IQR rule for outlier detection
• Always sort first: Sorting data is essential for accurate quartile calculation
• Understand odd/even rules: Different methods apply based on dataset size
• Focus on middle 50%: IQR represents the core of the data distribution
• Robust measurement: IQR is reliable even when outliers are present
• Practical applications: Use IQR for real-world data analysis and comparison
Questions & Answers
Question: Why is IQR considered more robust than the range as a measure of spread? What's the difference?
Answer: The key difference lies in what data values they consider:
- Range: Maximum - Minimum (uses only 2 extreme values)
- IQR: Q3 - Q1 (uses the middle 50% of data)
IQR is more robust because it completely ignores the extreme values (outliers) that can dramatically affect the range. For example, in a dataset [1, 2, 3, 4, 100], the range is 99 (heavily influenced by the outlier 100), but the IQR is only 2 (showing the actual spread of the middle values).
This makes IQR a more reliable measure of typical variability in the dataset.
Question: When calculating Q1 and Q3 for an odd number of data points, should I include the median in both halves or exclude it?
Answer: There are different conventions, but the most common approach is to exclude the median:
- Find the median of the entire dataset
- Exclude it when creating the lower and upper halves
- Calculate Q1 as the median of the lower half
- Calculate Q3 as the median of the upper half
For example, with dataset [1, 2, 3, 4, 5]: median = 3, lower half = [1, 2], upper half = [4, 5]. This ensures Q1 and Q3 are equidistant from the overall median and maintains symmetry in the quartile system.
This is the standard method used in most textbooks and statistical software.
Question: How do I interpret different IQR values when comparing datasets? What constitutes a "large" or "small" IQR?
Answer: IQR interpretation is relative, not absolute. Here's how to evaluate it:
- Within same variable: A larger IQR indicates more variability in the middle 50%
- Relative to data range: Compare IQR to the overall range of the dataset
- Context-dependent: What's "large" depends on the variable being measured
For example, an IQR of $1000 might be small for annual incomes but large for daily expenses. Always consider the scale of your data and the practical significance of the differences.
When comparing datasets, the one with the larger IQR has more variability in its middle 50% of values, assuming similar scales of measurement.