Track 2 · Describing Data · Lesson 2 of 11
Mean, median and mode
Calculate the mean, median and mode, and choose the measure that honestly represents the centre of a dataset.
An HR report says the average commute at a company is 37 minutes. Yet six in ten employees travel for less than that, and half travel for 31.5 minutes or less — a few very long journeys pull the average up. Knowing which measure of centre to report, and why, is the difference between a summary that informs and one that misleads.
A measure of centre answers the question what is a typical value? with one number. There are three common answers, and they agree only when the data are roughly symmetric.
- The mean is the balance point: add the values and divide by how many there are.
- The median is the middle value once the data are sorted: half the observations are below it, half above.
- The mode is the most frequent value or category.
- the sample mean (read “x-bar”)
- the -th observation
- the number of observations
For the median, sort the values first. With an odd number of values the median is the one in position . With an even number there are two middle values, in positions and , and the median is their average.
Worked example
Seven commute times
Seven employees recorded their commute in minutes: 22, 35, 18, 27, 95, 31, 24. Find the mean and the median.
Mean. The total is , so minutes.
Median. Sort the values: 18, 22, 24, 27, 31, 35, 95. With the median is the value in position , which is 27 minutes.
Compare. Six of the seven commutes are below the mean of 36. The single 95-minute journey pulls the mean up, while the median does not move no matter how long that one journey is.
Mean = 36 minutes, median = 27 minutes. The median better describes the typical employee here.
Show the data as a table
| From | To | Count |
|---|---|---|
| 4 | 11.2 | 16 |
| 11.2 | 18.4 | 25 |
| 18.4 | 25.6 | 43 |
| 25.6 | 32.8 | 40 |
| 32.8 | 40 | 29 |
| 40 | 47.2 | 36 |
| 47.2 | 54.4 | 12 |
| 54.4 | 61.6 | 13 |
| 61.6 | 68.8 | 3 |
| 68.8 | 76 | 6 |
| 76 | 83.2 | 4 |
| 83.2 | 90.4 | 5 |
| 90.4 | 97.6 | 1 |
| 97.6 | 104.8 | 0 |
| 104.8 | 112 | 2 |
| 112 | 119.2 | 0 |
| 119.2 | 126.4 | 2 |
| 126.4 | 133.6 | 2 |
| 133.6 | 140.8 | 0 |
| 140.8 | 148 | 1 |
In the full company dataset the mean commute is about 37.3 minutes and the median is 31.5 minutes. The distribution is right-skewed: a long tail of slow commutes on the right. In a right-skewed distribution the mean usually lies to the right of the median, because every extreme value adds its full size to the total, while the median only cares about order. Here 145 of the 240 employees (60%) commute for less than the mean.
Quick check
A city reports household incomes. A handful of households earn over 10 million SAR a year. Which measure best describes a typical household?
The mode is the only measure of centre for categorical data: you cannot average car, bus and metro, but you can say which is most common. A dataset can have two modes (bimodal) or none worth reporting (when every value occurs once).
Dataset
Employee commute times
240 rows · one row = one employee (their typical one-way commute) · synthetic data
| Employee | Travel mode | Shift | Distance (km) | Commute time (minutes) |
|---|---|---|---|---|
| E001 | car | day | 9.6 | 24 |
| E002 | car | day | 13.2 | 38 |
| E003 | bus | day | 17.4 | 71 |
| E004 | walk | morning | 2.5 | 24 |
| E005 | walk | day | 0.9 | 10 |
| E006 | car | day | 7.6 | 22 |
Each row is one employee: travel mode, shift, distance and commute time.
| Situation | Prefer | Why |
|---|---|---|
| Roughly symmetric numbers, no extreme values | Mean | Uses every value; the basis of most inference |
| Skewed numbers or extreme values | Median | Resistant: extreme values cannot move it |
| Categories (nominal data) | Mode | The only measure that applies |
| Ordered categories (e.g. ratings 1–5) | Median or mode | Order is meaningful, distances may not be |
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
Mean of a small sample
A café recorded how many customers arrived in each of eight half-hour periods:
21, 15, 23, 48, 21, 33, 41, 18
What is the mean number of customers per period? Give your answer to 2 decimal places.
Exercise 2 · Practice, difficulty 1 of 3
Median with an even number of values
Ten delivery times (minutes) were recorded:
24, 23, 23, 22, 21, 29, 26, 17, 30, 37
Find the median delivery time.
Exercise 3 · Application, difficulty 2 of 3
Centre of the company's commutes
Use the commute dataset (240 employees). Calculate the mean and the median of commute_min. You can open the dataset in the lab to calculate.
Data: commute · Open in the lab to explore and calculate.
Exercise 4 · Interpretation, difficulty 2 of 3
Which number goes in the report?
The HR team wants one number for “the typical commute” in the internal newsletter. The commute data are right-skewed: most journeys take 15–45 minutes, but a few take over two hours. Which should they report?
Exercise 5 · Practice, difficulty 1 of 3
Choose the right measure
For each variable, choose the most appropriate measure of centre.
Exercise 6 · Challenge, difficulty 2 of 3
One extreme value
Nine employees' commutes (minutes) are 36, 26, 30, 24, 26, 36, 29, 29, 30. A tenth employee joins whose commute is 140 minutes.
By how many minutes does the mean increase, and by how many does the median increase? Give both to 2 decimal places.
Exercise 7 · Interpretation, difficulty 2 of 3
Explain the gap
In the commute data the mean (37.3 minutes) is about 6 minutes higher than the median (31.5 minutes). In two or three sentences, explain why the mean is higher and what that tells a reader about the data.
Exercise 8 · Practice, difficulty 1 of 3
Mode of travel
In the commute dataset, find the most common travel mode (the mode of the variable mode). What percentage of the 240 employees use it? Give the percentage to 1 decimal place.
Data: commute · Open in the lab to explore and calculate.
What you can now do
- Calculate the mean and the median by hand and from a dataset
- Find the mode, including for categorical data
- Explain why skew and extreme values separate the mean from the median
- Choose and justify the measure of centre for a report