Quartiles: Values that divide a dataset into four equal parts. Q1 (first quartile) = 25th percentile, Q2 (median) = 50th percentile, Q3 (third quartile) = 75th percentile.
- Arrange data in ascending order
- Find the median (Q2)
- Find Q1: median of the lower half of data
- Find Q3: median of the upper half of data
- For even counts, take average of two middle values
Ordered data: 12, 15, 18, 20, 22, 25, 28, 30, 35, 40
Number of values: 10 (even)
Already arranged: 12, 15, 18, 20, 22, 25, 28, 30, 35, 40
With 10 values (even), median is average of 5th and 6th values
Q2 = (22 + 25) ÷ 2 = 23.5
Lower half: 12, 15, 18, 20, 22 (first 5 values)
Q1 = median of lower half = 18 (middle value)
Upper half: 25, 28, 30, 35, 40 (last 5 values)
Q3 = median of upper half = 30 (middle value)
Q1 = 18, Q2 = 23.5, Q3 = 30
• Quartile positions: Q1 at 25%, Q2 at 50%, Q3 at 75%
• Even count median: Average of two middle values
• Half inclusion: Include median in both halves when count is odd
Interquartile Range (IQR): The range of the middle 50% of data, calculated as Q3 - Q1.
First dataset: Q1 = 18, Q3 = 30
Second dataset: Need to calculate Q1 and Q3
IQR = Q3 - Q1
IQR = 30 - 18 = 12
Ordered data: 5, 10, 15, 20, 25, 30, 35, 40, 45, 50
Q2 (median) = (25 + 30) ÷ 2 = 27.5
Lower half: 5, 10, 15, 20, 25 → Q1 = 15
Upper half: 30, 35, 40, 45, 50 → Q3 = 40
IQR = Q3 - Q1 = 40 - 15 = 25
First dataset IQR: 12
Second dataset IQR: 25
Second dataset has greater variability in the middle 50% of data
| Dataset | Q1 | Q3 | IQR |
|---|---|---|---|
| First | 18 | 30 | 12 |
| Second | 15 | 40 | 25 |
First dataset IQR = 12, Second dataset IQR = 25
• IQR formula: IQR = Q3 - Q1
• Variability measure: Higher IQR indicates greater spread
• Robustness: IQR is resistant to outliers
Outlier: A data value that is significantly different from other values in the dataset, often defined as values beyond Q1 - 1.5(IQR) or Q3 + 1.5(IQR).
Ordered data: 10, 15, 18, 20, 22, 25, 28, 30, 35, 40, 45, 50, 70
Number of values: 13 (odd)
With 13 values (odd), median is the 7th value
Q2 = 28
Lower half: 10, 15, 18, 20, 22, 25 (first 6 values)
Q1 = (18 + 20) ÷ 2 = 19
Upper half: 30, 35, 40, 45, 50, 70 (last 6 values)
Q3 = (40 + 45) ÷ 2 = 42.5
IQR = Q3 - Q1 = 42.5 - 19 = 23.5
Lower fence = Q1 - 1.5(IQR) = 19 - 1.5(23.5) = 19 - 35.25 = -16.25
Upper fence = Q3 + 1.5(IQR) = 42.5 + 1.5(23.5) = 42.5 + 35.25 = 77.75
Check each value against boundaries [-16.25, 77.75]
All values (10 to 70) are within boundaries
No outliers detected
No outliers detected (all values within [-16.25, 77.75])
• Outlier boundaries: Q1 - 1.5(IQR) and Q3 + 1.5(IQR)
• 1.5 × IQR rule: Standard method for outlier detection
• Robust measure: IQR-based detection is resistant to outliers
Quartiles: Values that divide a dataset into four equal parts (25% each).
Interquartile Range (IQR): The difference between the third and first quartiles (Q3 - Q1).
Outlier: A data value that falls significantly outside the overall pattern of the data.
Five-number summary: Minimum, Q1, Median, Q3, Maximum.
Box plot: A visual representation of the five-number summary.
- Order data: Arrange values from least to greatest
- Find median: Identify Q2 (middle value)
- Find Q1: Median of lower half of data
- Find Q3: Median of upper half of data
- Calculate IQR: Subtract Q1 from Q3
- Detect outliers: Use 1.5 × IQR rule
Variability: The degree to which data points differ from each other, measured by the spread of values.
Set A: 2, 4, 6, 8, 10, 12, 14, 16, 18, 20
Set B: 1, 2, 3, 5, 8, 12, 15, 17, 19, 20
Q2 = (10 + 12) ÷ 2 = 11
Lower half: 2, 4, 6, 8, 10 → Q1 = 6
Upper half: 12, 14, 16, 18, 20 → Q3 = 16
IQR_A = 16 - 6 = 10
Q2 = (8 + 12) ÷ 2 = 10
Lower half: 1, 2, 3, 5, 8 → Q1 = 3
Upper half: 12, 15, 17, 19, 20 → Q3 = 17
IQR_B = 17 - 3 = 14
IQR_A = 10
IQR_B = 14
Set B has greater variability in the middle 50% of data
Range_A = 20 - 2 = 18
Range_B = 20 - 1 = 19
Both measures confirm Set B has greater spread
| Set | Q1 | Q3 | IQR | Range |
|---|---|---|---|---|
| A | 6 | 16 | 10 | 18 |
| B | 3 | 17 | 14 | 19 |
Set B has greater variability: IQR = 14 vs IQR = 10
• Variability comparison: Higher IQR indicates greater spread
• Robust comparison: IQR is less affected by extreme values
• Consistency check: Compare with other measures for confirmation
Box plot: A graphical representation of the five-number summary (minimum, Q1, median, Q3, maximum).
| Statistic | Value | Description |
|---|---|---|
| Minimum | 5 | Lowest value |
| Q1 | 13.5 | First quartile (25th percentile) |
| Median | 21 | Second quartile (50th percentile) |
| Q3 | 27.5 | Third quartile (75th percentile) |
| Maximum | 40 | Highest value |
Ordered data: 5, 8, 12, 15, 18, 20, 22, 25, 28, 30, 35, 40
Min = 5, Max = 40
Median = (20 + 22) ÷ 2 = 21
Q1 = (12 + 15) ÷ 2 = 13.5
Q3 = (25 + 28) ÷ 2 = 26.5
IQR = Q3 - Q1 = 26.5 - 13.5 = 13
Lower fence = 13.5 - 1.5(13) = -6
Upper fence = 26.5 + 1.5(13) = 46
No outliers (all values within [-6, 46])
Center: Median = 21
Spread: IQR = 13, Range = 35
Shape: Slightly right-skewed (distance from Q1 to median is 7.5, from median to Q3 is 5.5)
Distribution is slightly right-skewed with IQR = 13
• Box plot interpretation: Length of box represents IQR
• Skewness detection: Unequal distances between Q1-Median and Median-Q3
• Outlier detection: Use 1.5 × IQR rule
Quartiles: Values that divide a dataset into four equal parts (25% each). Q1 = 25th percentile, Q2 = 50th percentile (median), Q3 = 75th percentile.
Interquartile Range (IQR): The range of the middle 50% of data, calculated as Q3 - Q1.
Outlier: A data value that falls significantly outside the overall pattern of the data, typically defined as values beyond Q1 - 1.5(IQR) or Q3 + 1.5(IQR).
Five-number summary: The minimum, Q1, median, Q3, and maximum values of a dataset.
Variability: The degree to which data points differ from each other, measured by the spread of values.
- Order the data: Arrange values from least to greatest
- Find the median (Q2): Middle value or average of two middle values
- Find Q1: Median of the lower half of the data
- Find Q3: Median of the upper half of the data
- Calculate IQR: IQR = Q3 - Q1
- Detect outliers: Use 1.5 × IQR rule
- Interpret results: Analyze variability and distribution shape
| Measure | Formula | Sensitivity to Outliers | When to Use |
|---|---|---|---|
| Range | Max - Min | Very High | Quick estimate, small datasets |
| IQR | Q3 - Q1 | Low | Robust measure, skewed data |
| Standard Deviation | √(Σ(x-μ)²/n) | High | Normal distributions, all data matters |
Odd count: For n values, Q1 is at position (n+1)/4, Q3 is at 3(n+1)/4
Even count: Split data into two equal halves, find median of each
Interpolation: When position is not a whole number, interpolate between adjacent values
Example: For 10 values, Q1 is between 2nd and 3rd values, Q3 is between 8th and 9th values
Robustness: IQR is not affected by extreme values or outliers
Central focus: Measures variability of the middle 50% of data
Units: Same units as the original data
Comparison: Higher IQR indicates greater variability
1.5 × IQR Rule: Values below Q1 - 1.5(IQR) or above Q3 + 1.5(IQR) are outliers
3 × IQR Rule: More conservative approach for extreme outliers
Context matters: Always consider if outliers are valid data points
Impact: Outliers can significantly affect mean and standard deviation
Box length: Represents IQR, indicates variability of middle 50%
Median position: If median is centered, distribution is symmetric; if off-center, distribution is skewed
Whisker lengths: Indicate spread of lower and upper 25% of data
Outliers: Points beyond whiskers, shown as individual dots
Questions & Answers
Question: I'm confused about why we use 1.5 × IQR to detect outliers. Why not 1 × IQR or 2 × IQR?
Answer: The 1.5 × IQR rule was developed by statistician John Tukey as a balance between sensitivity and specificity:
Why 1.5 specifically:
- 1 × IQR would be too sensitive: Would flag too many values as outliers, including legitimate data points
- 2 × IQR would be too conservative: Would miss actual outliers, keeping them in the analysis
- 1.5 × IQR strikes a balance: Detects true outliers while not over-flagging normal variations
Empirical basis: This rule was tested against normal distributions and found to work well in practice. For normally distributed data, about 99.3% of values fall within Q1 - 1.5(IQR) and Q3 + 1.5(IQR).
Flexibility: Some statisticians use 3 × IQR for extreme outliers or 1 × IQR for more sensitive detection, but 1.5 × IQR remains the standard.
Question: When should I use IQR instead of standard deviation to measure variability?
Answer: The choice depends on your data's characteristics:
Use IQR when:
- Your data is skewed (not normally distributed)
- Your data contains outliers
- You want a robust measure resistant to extreme values
- You're working with ordinal data
- You want to focus on the central portion of your data
Use standard deviation when:
- Your data is approximately normally distributed
- Your data doesn't contain significant outliers
- You need to perform further statistical calculations
- You want to include all data points in your measure
Key difference: IQR focuses on the middle 50% of data and is robust to outliers, while standard deviation uses all data points and is sensitive to extreme values.
Question: How do I know if my data is skewed by looking at quartiles and IQR?
Answer: You can assess skewness by comparing distances between quartiles:
Right skew (positive skew):
- Distance from Q3 to median > Distance from median to Q1
- Q3 - Median > Median - Q1
- The upper half of data is more spread out
Left skew (negative skew):
- Distance from median to Q1 > Distance from Q3 to median
- Median - Q1 > Q3 - Median
- The lower half of data is more spread out
Symmetric distribution:
- Distance from Q3 to median ≈ Distance from median to Q1
- Q3 - Median ≈ Median - Q1
Example: If Q1 = 10, Median = 20, Q3 = 35, then Q3 - Median = 15 and Median - Q1 = 10. Since 15 > 10, the data is slightly right-skewed.