Menu

Quartiles, Percentiles and Outliers

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

Q125thAbout a quarter of the values fall at or below it
Q250thThe median
Q375thAbout 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.

  1. The data is sorted and has 10 values. The median is (20 + 22) / 2 = 21.
  2. The lower half is 12, 15, 17, 18, 20, so Q1 = 17. The upper half is 22, 24, 25, 27, 95, so Q3 = 25.
  3. IQR = 25 − 17 = 8
  4. Lower fence = 17 − 1.5 × 8 = 5
  5. Upper fence = 25 + 1.5 × 8 = 37
  6. 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

AP

Abhishek Pati



Learn via Video Course

Probability and Statistics for Data Science Logo

Probability and Statistics for Data Science

4 hrs



Get in Touch For Details