Contents
Quartiles, Percentiles and Outliers
Mean and standard deviation react strongly to extreme values. Quartiles and percentiles describe position within the data and are more stable when a few values are unusual.
Percentiles and Quartiles
A percentile is a value below which a given percentage of the data falls. If a delivery time is at the 90th percentile, about 90% of deliveries were as fast or faster. Quartiles are three percentiles that divide sorted data into four equal parts.
Term | Percentile | Meaning |
| Q1 | 25th | About a quarter of the values fall at or below it |
| Q2 | 50th | The median |
| Q3 | 75th | About three-quarters of the values fall at or below it |
Interquartile Range
IQR = Q3 − Q1
- IQR: the width of the middle half of the data. A larger IQR means the middle half of the data is more spread out.
- Q3: the third quartile, the 75th percentile.
- Q1: the first quartile, the 25th percentile.
Flagging Outliers
A common rule marks a value as an outlier if it falls outside these limits:
Lower fence = Q1 − 1.5 × IQR
Upper fence = Q3 + 1.5 × IQR
- 1.5: a conventional multiplier. It is a widely used rule of thumb and not a fixed law.
- Fences: the boundaries of the range considered normal. Anything beyond them is flagged for a closer look.
Example: Test the data 12, 15, 17, 18, 20, 22, 24, 25, 27, 95 for outliers.
- The data is sorted and has 10 values. The median is (20 + 22) / 2 = 21.
- The lower half is 12, 15, 17, 18, 20, so Q1 = 17. The upper half is 22, 24, 25, 27, 95, so Q3 = 25.
- IQR = 25 − 17 = 8
- Lower fence = 17 − 1.5 × 8 = 5
- Upper fence = 25 + 1.5 × 8 = 37
- Since 95 is above 37, it is flagged as an outlier. All other values lie between 5 and 37.
Software packages calculate quartiles with slightly different methods, so Q1 and Q3 may differ a little from one tool to another. The conclusion about 95 stays the same here.
A flagged value is not automatically a mistake. A sensor reading of 95 might be a faulty entry, or it might be a genuine spike that a fault detection model needs to learn from. Check where the value came from before deciding to remove, correct or keep it.
Probability and Statistics for Data Science
Abhishek Pati








