Statistics · Descriptive
Mean, median, mode, and when each one lies
Anyone can define them. The interview question is "which would you report for salaries, and why?" Answering that is the whole lesson.
The three definitions
| Measure | What it is | Excel | SQL |
|---|---|---|---|
| Mean | Sum ÷ count | AVERAGE | AVG(x) |
| Median | Middle value after sorting. If the count is even, average the two middles. | MEDIAN | PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY x) |
| Mode | Most frequent value. There can be none, or several. | MODE.SNGL | GROUP BY x ORDER BY COUNT(*) DESC LIMIT 1 |
Definitions follow OpenStax Statistics §2.5. Note that SQL has no universal MEDIAN(). PostgreSQL, SQL Server and Oracle use PERCENTILE_CONT.
One outlier, two answers
Five employees earn 30k, 35k, 40k, 45k and the founder earns 400k.
Skew: where the tail goes, the mean follows
Decision rule
Numbers, roughly symmetric
→ MeanHeights, test scores, daily temperatures
Numbers, skewed or outliers
→ MedianIncome, house prices, delivery times, session length
Categories
→ ModeMost popular size, top payment method, busiest weekday
Bonus: say "and the spread"
Centre alone hides variation. Mention the standard deviation (with the mean) or the IQR (with the median).Retrieval check
What is the median of 7, 3, 9, 1, 5?
What is the median of 2, 4, 6, 8?
Which measure would you report for typical house prices in a city?
In right-skewed data, what is the usual ordering?
What is the best "average" for the most popular T-shirt size (S/M/L/XL)?
Type it
Drop the founder. What's the new median (in k) of 30, 35, 40, 45?
Excel: the median of salaries in A2:A101.
Your turn
- In Excel, enter 30, 35, 40, 45, 400. Compute AVERAGE, MEDIAN and MODE.SNGL. (Mode →
#N/A: there's no repeat.) - Change 400 to 4000. Which number moved and which didn't?
- Use the Lesson 3 sales data: the mean vs median of Revenue. Is it skewed?
- Sketch the right-skew curve from memory and label mode, median and mean.
- Think of 3 business metrics at your target company and say which centre measure you'd use for each.
Go deeper
Related: Lesson 7: Hypothesis testing · Stats cheat sheet · Statistics question bank