Quartiles, IQR & Box Plots
Quartiles and the interquartile range, the 1.5 x IQR outlier rule, the five-number summary, and how to build and read a box plot — with fully worked examples.
21. Quartiles
[T]
What they are
Quartiles cut sorted data into four parts. Q2 is always the median.
| Position formula | Meaning | |
|---|---|---|
| Q1 (quartile 1) | ¼ (n + 1) | 25% of the data is less than or equal to this value |
| Q2 (quartile 2 = median) | (n + 1) / 2 | 50% of the data is ≤ this value |
| Q3 (quartile 3) | ¾ (n + 1) | 75% of the data is ≤ this value |
Restated: Q1 talks about the first 25% of the population, Q2 the first 50%, Q3 the first 75%.
The marks illustration
If a class’s marks give Q1 = 10, Q2 = 25, Q3 = 40:
- 25% of students scored ≤ 10 marks
- 50% of students scored ≤ 25 marks
- 75% of students scored ≤ 40 marks
A second worked illustration (7 values)
n = 7
Q1 position = ¼ × (7 + 1) = 2 → 2nd value = 9
Q2 position = (7 + 1) / 2 = 4 → 4th value = 18
Q3 position = ¾ × (7 + 1) = 6 → 6th value = 24
Reading it: 25% of the data ≤ 9 · 50% ≤ 18 · 75% ≤ 24.
Prerequisite
Student: “While creating these ranges, we always have to make sure our dataset is in ascending order.” Instructor: “Yes. Ascending order.”
Always sort ascending before computing any quartile.
When the position comes out as a decimal
A student asked what to do when ¼(n+1) or (n+1)/2 gives a non-integer.
Worked answer for n = 18:
Q2 position = (18 + 1) / 2 = 19 / 2 = 9.5
→ take BOTH the 9th and the 10th values and average them
“So you should take 9 and 10, both the values… ninth value and tenth value.”
Use case
Questions like “what is the income of the bottom 50% of the population?” are answered directly by quartiles. They also feed the five-point summary used in Exploratory Data Analysis (EDA).
22. Interquartile Range (IQR)
[T]
Formula
IQR = Q3 − Q1
What it captures
The middle 50% of the data.
“Means we are taking only the middle 50% of the data — we can ignore the outliers.”
Why that matters: by using only the middle half, IQR automatically excludes the extremes, making it robust to outliers in a way that range is not.
The classification question raised in class
Student: “We are calling IQR a measure of variability, but here we are using the median — and the median is more of a central tendency. Right?”
This was a genuinely good question and prompted a full explanation.
The resolution: IQR measures a spread — a distance between two points — not a centre. The parallel drawn was with range:
| What it uses | What it ignores | |
|---|---|---|
| Range | The two extremes (max, min) | The entire middle |
| IQR | The middle (Q1 to Q3) | Both extremes |
“Range — it’s a measure of variability, because you are taking two extreme [values] but the middle things you are ignoring. Here [IQR] we are ignoring the extreme things, we are picking up the middle terms. In that way we can ignore the outliers.”
Both are measures of variability. They simply select different parts of the distribution.
IQR’s real purpose
“Even though it is a measure of variability, IQR’s purpose is for something else — to identify whether the data is having outliers or not.”
23. The 1.5 × IQR Outlier Rule
[T]
This is the standard answer to “how do I identify the outliers in my dataset?”
The formulas
Lower whisker / Lower limit = Q1 − 1.5 × IQR
Upper whisker / Upper limit = Q3 + 1.5 × IQR
Any value below the lower limit, or above the upper limit, is an OUTLIER.
“So IQR is mostly used for calculating the outliers. Someone asked how do I identify the outlier in my dataset — this is the formula.”
On the 1.5 multiplier
A point of active discussion in class:
- 1.5 is the worldwide standard. “Most statisticians worldwide accept 1.5 is good.”
- Most of industry follows 1.5.
- Some practitioners relax it to 2.0 — Q3 + 2 × IQR.
- You can tighten it below 1.5 if you specifically want to flag borderline values as outliers. “If you want [a particular value] as an outlier, you need to reduce that 1.5 to something.”
- It is not mandatory. “It is not 100% you need to follow, but most of the industry follows 1.5.”
- It depends on your data.
24. Worked Example A — the 1 and 100 Dataset
[T]
The instructor added an extreme low (1) and an extreme high (100) to an existing dataset and showed something important first:
Q1, Q2 and Q3 did not change at all after adding both extremes. “Even though I introduced 1 and 100 newly, Q1, Q2, Q3 did not change.”
This is the demonstration that quartiles resist outliers.
The calculation
Q1 = 9 Q2 = 18 Q3 = 24
IQR = Q3 − Q1 = 24 − 9 = 15
1.5 × IQR = 1.5 × 15 = 22.5
Lower limit = Q1 − 22.5 = 9 − 22.5 = −13.5
Upper limit = Q3 + 22.5 = 24 + 22.5 = 46.5
The verdicts
| Value | Test | Verdict |
|---|---|---|
| 1 (the minimum) | 1 > −13.5 | NOT an outlier |
| 100 | 100 > 46.5 | IS an outlier |
The hypothetical extension: “Assume that instead of 1, we have −20 in our dataset. Then −20 is less than −13.5, so we’ll say it’s an outlier.”
The resulting box plot
−13.5 46.5
|------[========|=============]-------------| ● 100
9 18 24 outlier
- Box from Q1 = 9 to Q3 = 24
- Median line at 18
- Lower whisker at −13.5, upper whisker at 46.5
- 100 marked as an individual outlier point
25. Worked Example B — the 11-Value Dataset
[T+S]
Dataset: 7, 8, 8, 9, 10, 10, 10, 11, 12, 14, 30 (n = 11)
Using the class (n + 1) position formulas
Q1 position = ¼ × (11 + 1) = 12 / 4 = 3 → 3rd value = 8
Q2 position = (11 + 1) / 2 = 12 / 2 = 6 → 6th value = 10 ← median
Q3 position = ¾ × (11 + 1) = 9 → 9th value = 12
IQR = Q3 − Q1 = 12 − 8 = 4
1.5 × IQR = 6
Lower limit = 8 − 6 = 2
Upper limit = 12 + 6 = 18
Result: 30 > 18 → 30 is an OUTLIER.
The box plot for this data
2 18
|------[====|=========]---------| ● 30
8 10 12 outlier
The whisker refinement — an important practical note
Instructor: “In practice, because our data doesn’t have [a value at 2], we’ll stop at 7. This whisker length will become small — we will keep 7 as the whisker. Because 2 is not part of our data. We don’t have data beyond 7, so we start the whisker here only in reality.”
Real box-plot software stops the whisker at the last ACTUAL data value, not at the theoretical computed limit.
Exam guidance given explicitly:
Student: “As exam point of view, the right answer will be whatever comes at lower limit — either it’s 2 or whatever?” Instructor: “Either you keep 7 or 2, you’ll get marks. Don’t worry. No one will reduce the marks.”
So both conventions are acceptable in an exam — but you should calculate and state the limit (2) and can then note that the actual minimum is 7.
Note on the printed slide values
The slide for this dataset lists Q1 = 8.5, Q3 = 11.5 (which gives IQR = 3, limits 4 and 16). That is Excel’s QUARTILE.INC interpolation method, not the (n+1) position formula worked on the board.
Both methods correctly flag 30 as the outlier. Use the (n+1) formula the instructor taught unless a question specifies otherwise — but be aware that quartile conventions differ, which is why the two answers don’t match exactly.
26. The Box Plot & Five-Point Summary
[T]
The structure
lower limit upper limit
(lower whisker) (upper whisker)
| |
|------[==========|=================]--------------| ●
Q1 Q2 (median) Q3 outlier
How to construct it — step by step
- Draw the box — left edge at Q1, right edge at Q3
- Draw a line inside the box at Q2 (the median) — this is the centre value
- Extend the lower whisker to Q1 − 1.5 × IQR
- Extend the upper whisker to Q3 + 1.5 × IQR
- Plot any value beyond either whisker as an individual point — an outlier
“It looks very heavy, hectic. It’s very simple.”
The Five-Point (Five-Number) Summary
The box plot is also called the five-point summary:
Minimum · Q1 · Q2 (Median) · Q3 · Maximum
Where in this context “minimum” and “maximum” mean the whisker limits:
- Minimum = Q1 − 1.5 × IQR
- Maximum = Q3 + 1.5 × IQR
“Why five point? Minimum, Q1, Q2, Q3, and maximum value. Maximum value means Q3 plus 1.5 [× IQR].”
Where it’s used
The five-point summary is a standard step in Exploratory Data Analysis (EDA).
27. Practice Problem — Restaurant Wait Times
[T+S]
The question
A restaurant recorded the wait time (in minutes) for 18 tables on a busy Friday night:
5, 8, 10, 10, 12, 13, 15, 15, 16, 18, 19, 20, 22, 24, 25, 28, 32, 50Using this data:
- a) Find the five-number summary (minimum, Q1, median, Q3, maximum)
- b) Calculate the interquartile range (IQR)
- c) Determine whether any values are outliers, using the 1.5 × IQR rule
- d) Draw a box plot to represent the data
- e) Interpret the box plot: what does it tell you about how busy the restaurant was?
Step 1 — Order the data
Already in ascending order. n = 18.
Step 2 — Five-number summary
Median (Q2): n is even → average of the 9th and 10th values
(19 / 2 = 9.5, so take both)
= (16 + 18) / 2 = 17
Q1: median of the lower half (5, 8, 10, 10, 12, 13, 15, 15, 16)
→ 5th value = 12
Q3: median of the upper half (18, 19, 20, 22, 24, 25, 28, 32, 50)
→ 5th value = 24
Step 3 — IQR
IQR = Q3 − Q1 = 24 − 12 = 12
Step 4 — Outlier limits
Lower limit = Q1 − 1.5 × IQR = 12 − 18 = −6
Upper limit = Q3 + 1.5 × IQR = 24 + 18 = 42
Step 5 — Identify outliers
Any value < −6 or > 42 ?
50 > 42 ⇒ 50 is an OUTLIER
Step 6 — Box plot
−6 42
|------[=========|===============]-----------------| ● 50
12 17 24 outlier
Step 7 — Interpretation (the full class discussion)
The statistical reading: half the tables waited 17 minutes or less, and the middle 50% waited between 12 and 24 minutes — a moderately busy but reasonably consistent evening.
The business reading (discussed at length):
“It means that there is one scenario where people waited 50 minutes. Maybe that day they had some service issue in the kitchen. Or maybe there was a big party going on, that crowd did not move out.”
What the owner should do — root cause analysis:
- Check whether it’s a data error first — “just go and check whether it is a typo error from your side, or it really happened.”
- If real, do the post-mortem — “then the owner will go and say, hey, what happened that day?”
- Fix it if capacity allows — “they will do the root cause analysis. If they have capacity to reduce that, they will try to reduce.”
Why it matters commercially (raised by a student and endorsed):
“Maybe on some more Fridays they will face more number of minutes. So that will cause the restaurant a bad name. Such things we can avoid using this.”
The framing: this is post-hoc data analysis — feedback from data that drives an operational fix.
Note on alternative answers
One participant computed the limits as −9.25 and 44.75 using a different quartile convention (Excel-style interpolation rather than median-of-halves).
Both methods identify 50 as the only outlier, so the conclusion is unchanged. The board answer (−6 / 42) uses the median-of-halves method.