Track 2 · Describing Data · Lesson 6 of 11

Five-number summary and outliers

Give a five-number summary, read and build a box plot, flag outliers with the 1.5 × IQR rule, and decide sensibly what to do with them.

30 minFoundation8 graded exercisesFree

An operations analyst finds 14 employees whose commutes are flagged as “outliers”. Should they be deleted before the report? Usually not — but some unusual values are errors. Knowing how outliers are flagged, and what the flag does and does not mean, prevents both mistakes.

The five-number summary describes a distribution with five resistant landmarks: minimum, Q1Q_1, median, Q3Q_3, maximum. Together they show the centre (median), the spread of the middle half (IQR =Q3−Q1= Q_3 - Q_1), the full extent (range), and — by comparing the gaps — the skew.

As in the previous lesson, quartiles here use the type 7 method; another convention could move Q1Q_1 and Q3Q_3 slightly for small samples.

lower fence=Q1−1.5×IQR,upper fence=Q3+1.5×IQR\text{lower fence} = Q_1 - 1.5 \times \text{IQR}, \qquad \text{upper fence} = Q_3 + 1.5 \times \text{IQR}
Tukey's fences: values outside them are flagged as potential outliers
IQR\text{IQR}
the interquartile range, Q3−Q1Q_3 - Q_1
1.51.5
Tukey's conventional multiplier. Values beyond 3×IQR3 \times \text{IQR} from the quartiles (the outer fences) are often called extreme outliers.

Worked example

Nine call durations

Nine support calls lasted (minutes, sorted): 18, 22, 25, 27, 31, 34, 38, 41, 96. Give the five-number summary and check for outliers.

  1. Five numbers. With n=9n = 9, Q1Q_1 sits at position h=8×0.25+1=3h = 8 \times 0.25 + 1 = 3 (value 25), the median at position 5 (31) and Q3Q_3 at position 7 (38). Summary: 18, 25, 31, 38, 96.

  2. IQR =38−25=13= 38 - 25 = 13, so 1.5×IQR=19.51.5 \times \text{IQR} = 19.5.

  3. Fences: lower 25−19.5=5.525 - 19.5 = 5.5, upper 38+19.5=57.538 + 19.5 = 57.5. Only 96 lies outside. It is even beyond the outer fence 38+3×13=7738 + 3 \times 13 = 77: an extreme outlier.

  4. Box plot. The box runs from 25 to 38 with a line at 31; the lower whisker reaches 18; the upper whisker stops at 41, the largest value inside the fences; 96 is drawn as a separate point.

Five-number summary 18, 25, 31, 38, 96; one (extreme) outlier at 96 minutes — worth checking, but not automatically wrong.

Loading the interactive…
Build a box plot of commute times step by step: quartiles, IQR, fences, whiskers and flagged points, for each travel mode.

Try this

  • Step through the construction for car. Where does the upper whisker stop, and why not at the largest value?

  • Switch to walk. Are the fences closer together or further apart than for car? What does that say about the spread of walking commutes?

  • Compare the medians across modes. Which mode has the longest typical commute?

For all 240 commutes in the (synthetic) commute dataset, the five-number summary is 4, 23, 31.5, 46, 148 minutes. IQR =23= 23, so the fences are 23−34.5=−11.523 - 34.5 = -11.5 and 46+34.5=80.546 + 34.5 = 80.5 minutes. No commute is below the lower fence (none can be negative anyway), and 14 are above 80.5 minutes.

Four box plots of departure delay by carrier, each with a narrow box near 0 to 50 minutes and many outlier points extending to several hundred minutes.Amber AirCobalt WingsJade SkywaysSienna JetDeparture delay (minutes)
Departure delays (minutes) by carrier, flight_delays dataset. The boxes sit near zero; long strings of flagged points stretch to the right.
Show the data as a table
GroupnLower whiskerQ1MedianQ3Upper whiskerOutliersMean
Amber Air832-17-3-118.255010116.6659
Cobalt Wings667-16-2.54491254633.2009
Jade Skyways570-14-4-211327110.0193
Sienna Jet431-14-3434844325.9443

When a value is flagged

  1. Check it. Is it possible? Was it recorded in the right units? Is it a code for “missing”?
  2. If it is an error, correct it from the source if you can; otherwise set it to missing and say so.
  3. If it is genuine, keep it. Prefer resistant summaries (median, IQR) when extreme values dominate, and report how many values were flagged.
  4. If it changes the conclusion, report the analysis both with and without it — never quietly drop data.

Quick check

In a box plot, how far does the upper whisker reach?

Exercises

The lesson is complete when every exercise is answered correctly. Hints are free; viewing a worked solution before solving means the exercise won't count towards mastery.

0 of 8 exercises correct (not saved — sign in to keep your progress)

Exercise 1 · Guided, difficulty 1 of 3

Five-number summary

Not started

Nine patients waited the following number of minutes in an emergency department triage queue:

24, 57, 13, 11, 38, 19, 54, 28, 36

Give the five-number summary (quartiles by the type 7 method).

Exercise 2 · Practice, difficulty 1 of 3

Compute the fences

Not started

Monthly electricity bills of households in a district have Q1=2360Q_1 = 2360 SAR and Q3=3520Q_3 = 3520 SAR. Using the 1.5 × IQR rule, find the lower and upper fences.

Exercise 3 · Practice, difficulty 2 of 3

How many outliers?

Not started

A quality engineer measured the tensile strength (MPa above specification) of 16 welded joints:

47, 45, 50, 39, 47, 53, 52, 22, 83, 53, 62, 40, 51, 43, 53, 37

Using type 7 quartiles and the 1.5 × IQR rule, how many of the 16 values are flagged as outliers?

Exercise 4 · Application, difficulty 2 of 3

Flagged commutes

Not started

Using commute_min in the commute dataset, find the upper fence (1.5 × IQR rule, type 7 quartiles), the number of employees above it, and how many of those are also above the outer fence Q3+3×IQRQ_3 + 3 \times \text{IQR}.

Data: commute · Open in the lab to explore and calculate.

Exercise 5 · Application, difficulty 2 of 3

Flagged flight delays

Not started

Apply the 1.5 × IQR rule to delay_min in the flight_delays dataset (2 500 departures). How many departures are flagged, and what percentage of all departures is that (1 decimal place)?

Data: flight_delays · Open in the lab to explore and calculate.

Exercise 6 · Practice, difficulty 2 of 3

What should happen to this value?

Not started

Each value below was flagged as an outlier. Decide what should happen to it.

An employee's commute recorded as 1 400 minutes (over 23 hours, one way)
A temperature of −999 in a sensor log where the manual says −999 means “no reading”
A motor claim of 480 000 SAR that the claims team has verified against the repair invoices
A 4.5-hour flight delay on a day with a reported dust storm
A lab result 10 times the usual range, from a sample that has not yet been re-tested
A grocery basket of 4 780 SAR at a branch whose largest basket is usually about 500 SAR

Exercise 7 · Interpretation, difficulty 2 of 3

What a box plot cannot show

Not started

A manager compares box plots of delivery times for two depots. Which of these questions can the box plots not answer?

Choose one

Exercise 8 · Practice, difficulty 1 of 3

Building a box plot

Not started

Put the steps for drawing a box plot by hand in order.

Put the steps in order (use the arrows)

  1. 1Find the median, Q1Q_1 and Q3Q_3, and draw the box from Q1Q_1 to Q3Q_3 with a line at the median
  2. 2Sort the data
  3. 3Draw each whisker to the most extreme data value still inside its fence
  4. 4Plot every value outside the fences as a separate point
  5. 5Compute the IQR and the fences Q1−1.5×IQRQ_1 - 1.5 \times \text{IQR} and Q3+1.5×IQRQ_3 + 1.5 \times \text{IQR}

What you can now do

  • Give a five-number summary and read it for centre, spread and skew
  • Build and read a box plot, including where the whiskers stop
  • Flag potential outliers with the 1.5 × IQR fences (and extreme ones with 3 × IQR)
  • Decide whether a flagged value is an error, a genuine value, or needs checking