Box-and-whisker plots — quartiles, IQR
WHY do we need quartiles at all?
The mean tells you a "centre", but it lies to you when data is skewed or has outliers (one billionaire ruins the average income). We want a description that is robust — insensitive to a few extreme values.
Idea: instead of averaging, just sort the data and mark positions. If you stand in a queue of incomes ordered small→large, "the person exactly in the middle" (the median) is a fair centre no matter how rich the richest is.
Extend the idea: mark the person 1/4 of the way, and 3/4 of the way. Now you have three cut points splitting the queue into four equal parts. Those cut points are the quartiles.
HOW to compute quartiles (from scratch)
Step 0 — sort the data ascending. (Everything below assumes this.)
Step 1 — median :
- odd → middle value, position .
- even → average of the two middle values.
Step 2 — split into halves. The lower half = all values below the median position; upper half = all above.
- If is odd, the median itself is not placed in either half.
- If is even, the two halves each get exactly values.
Step 3 — = median of lower half, = median of upper half.
IQR — the spread of the middle 50%
Detecting outliers — the 1.5 × IQR fences
We need a rule for "unusually far from the pack." Tukey's rule builds a fence using the IQR as a natural yardstick.
WHY 1.5? It's a convention chosen so that, for roughly normal data, only about 0.7% of points get flagged — rare enough to be interesting, not so strict that nothing shows. (Multiplier 3.0 marks "far out" extreme outliers.)
Anatomy of the plot

- Left whisker end → smallest non-outlier
- Box left edge →
- Line in box → median
- Box right edge →
- Right whisker end → largest non-outlier
- Dots beyond whiskers → outliers
Worked Example 1 — odd
Data: ()
Sort: — Why? Quartiles are defined by position, meaningless unsorted.
Median : position → value . Why? Middle of 7 items.
Lower half (below the median, exclude it): . → . Upper half: . → . Why exclude the median? odd, so it belongs to neither half.
IQR .
Fences: ; . No value outside → no outliers.
Worked Example 2 — even + an outlier
Data (sorted): ()
Median: average of 5th & 6th values . Why? Even , no single middle.
Lower half (first 5): → (its median). Upper half (last 5): → . Why split 5/5? Even divides cleanly.
IQR .
Upper fence . The value → outlier! Why does this matter? The right whisker stops at (largest value ≤ 13), and is drawn as a lone dot.
Forecast-then-Verify
Recall Feynman: explain it to a 12-year-old
Line up all your friends shortest to tallest. The kid exactly in the middle is the median. Now find the middle of the shorter half and the middle of the taller half — those two split everyone into four equal groups. The box plot is just a box drawn from the first split to the third split, with a line at the middle. The whiskers are arms reaching out to the shortest and tallest kids who aren't weirdly extreme. If someone is super far out (like a giant), we draw them as a lonely dot — that's an outlier.
Recall checklist
Connections
- Median and Measures of Central Tendency — is the median.
- Range and Spread — IQR is the robust cousin of range.
- Outliers and Robust Statistics — the 1.5×IQR rule lives here.
- Percentiles and Quantiles — quartiles are the 25/50/75 percentiles.
- Skewness — box asymmetry reveals skew.
- Normal Distribution — why 1.5 flags ≈0.7%.
What is the median of a data set?
How do you find ?
Define the IQR.
Why is IQR preferred over the range for spread?
State the outlier fences.
Where does a whisker end?
For find .
Why the multiplier 1.5 in the outlier rule?
Concept Map
Hinglish (regional understanding)
Intuition Hinglish mein samjho
Dekho, box plot ka basic idea simple hai: apne data ko sort karo, aur usko 4 equal parts mein todo. Beech wala cut point median () hai — yeh centre batata hai. Fir lower half ka median hota hai aur upper half ka median . Yahi teen cut points quartiles kehlate hain. Iska sabse bada faida yeh hai ki median aur quartiles outliers se disturb nahi hote — agar ek banda crore ki salary leke aa jaaye, average toh hil jaata hai, par median chill rehta hai.
IQR ka matlab hai , yaani beech ke 50% data ka spread. Yeh normal range (max − min) se better hai kyunki range sirf do extreme points pe depend karta hai, jabki IQR outer 25% ko ignore kar deta hai. Isliye IQR ko "robust" spread bolte hain.
Outlier pakadne ke liye 1.5 × IQR fence rule use karo: lower fence , upper fence . Jo point in fences ke bahar hai, woh outlier hai aur usko lonely dot ki tarah draw karte hain. Whisker fence tak nahi, balki fence ke andar wale sabse door data point tak jaata hai — yeh point yaad rakhna, exam mein log yahin galti karte hain.
Yaad rakhne ka trick: "Sort, Split, Snip" — pehle sort, fir median pe split, fir har half ka apna median nikaalo. Agar odd hai toh median ko halves mein mat daalo. Bas itna dhyan rakho aur box plot ekdum easy ho jaayega.