Overview
Range and IQR are measures of spread that describe how dispersed the data is. IQR is more robust to outliers than range.
Range
Definition
Properties
- Simplest measure of spread
- Uses only two values (extremes)
- Very sensitive to outliers
- Increases with sample size
Example
Data: 3, 7, 8, 12, 15, 18, 22
Interquartile Range (IQR)
Definition
Where:
- = 25th percentile (first quartile)
- = 75th percentile (third quartile)
Properties
- Measures spread of middle 50% of data
- Resistant to outliers
- Used in boxplots
- More stable than range
Calculating Quartiles
- Order data from lowest to highest
- Find the median ()
- = median of lower half
- = median of upper half
Five-Number Summary
A complete summary of data distribution:
| Value | Description |
|---|---|
| Minimum | Smallest value |
| 25th percentile | |
| Median () | 50th percentile |
| 75th percentile | |
| Maximum | Largest value |
Outlier Detection
Using IQR Method
Lower fence:
Upper fence:
- Values below lower fence or above upper fence are considered outliers
- For extreme outliers: use
Boxplot Components
┌───────────────┐
─────────────── │ │ │ ───────────────
Min Q₁ Q₂ Q₃ Max
└───────────────┘
IQR
| Part | Represents |
|---|---|
| Box | Middle 50% (IQR) |
| Line in box | Median |
| Whiskers | Data within 1.5×IQR |
| Points | Outliers |
Examples
Example 1: Calculating IQR
Data: 2, 3, 5, 6, 7, 8, 9, 11, 12
Lower half: 2, 3, 5, 6 →
Upper half: 8, 9, 11, 12 →
Example 2: Outlier Detection
Using Example 1: , ,
Any value below -5 or above 19 is an outlier.
Example 3: With Outliers
Data: 2, 3, 5, 6, 7, 8, 9, 11, 12, 50
- Range = 50 - 2 = 48 (heavily affected by outlier)
- , , IQR = 6 (minimally affected)
- Upper fence = 10.5 + 9 = 19.5
- 50 > 19.5, so 50 is an outlier
Comparison: Range vs IQR
| Aspect | Range | IQR |
|---|---|---|
| Formula | Max - Min | |
| Uses | Extreme values | Middle 50% |
| Outlier resistance | None | High |
| Information used | 2 points | All data |
| Best for | Quick overview | Robust analysis |
Semi-Interquartile Range
Also called quartile deviation: