Introduction to Statistics (Stanford)
A beginner-level Stanford course covering descriptive stats, probability, regression, and hypothesis tests, taught across 12 self-paced modules.
The mean is the arithmetic average: add everything up and divide by the count. The median is the middle value when the data is sorted. The mode is the most frequent value. When data is symmetric, the three are close. When data is skewed or has outliers, as with salaries, house prices or order values, the mean can be pulled far from what's typical, and the median usually describes the "typical" case better.
"Average" is the most-used statistic in business and one of the easiest to misread. A single number on a dashboard can hide a very different picture, and choosing the wrong measure of center is a common way analysis misleads people without anyone meaning it to.
A small analytics team of ten people has these annual salaries (in thousands of US dollars):
45, 48, 50, 52, 55, 55, 58, 60, 62, 400
The last one is the department head, who also holds equity.
| Measure | How it's calculated | Result |
|---|---|---|
| Mean | 885 ÷ 10 | $88.5K |
| Median | Middle of the sorted list: (55 + 55) ÷ 2 | $55K |
| Mode | Most frequent value | $55K |
A job ad that says "average salary on this team: $88.5K" is technically true. But nine of the ten people earn $62K or less. One outlier moved the mean up by more than $30K. The median ($55K) describes what a typical team member earns.
Remove the department head and the mean drops to about $54K, while the median barely moves (to $55K). That's the key property: the median is robust to outliers, and the mean isn't.
Many business quantities are right-skewed: most values are modest, with a long tail of very large ones.
In right-skewed data, the mean is larger than the median, sometimes by a lot. In left-skewed data (for example, exam scores where most people do well), the mean is below the median.
A quick diagnostic: if the mean and median differ a lot, the data is skewed or has outliers. Look at a histogram before choosing which one to report.
Use the mean when:
Use the median when:
Use the mode when:
An online store reports average order value (AOV) = $64. Marketing designs a promotion: "spend $60, get free shipping", assuming most orders are near $64.
The median order value is actually $38. A handful of B2B bulk orders pull the mean up. The typical customer is far below the threshold, so the promotion barely changes their behavior. Meanwhile, the bulk buyers get free shipping they would have paid for.
Both numbers are correct. They answer different questions: the mean is right for revenue planning, and the median is right for designing offers around typical customers. Good dashboards often show both.
A center without a spread is half the story. Two stores can have the same median delivery time of 2 days, one with nearly every order in 1–3 days and the other ranging from same-day to 3 weeks. Pair the median with the interquartile range (25th to 75th percentile), and pair the mean with the standard deviation. A box plot shows all of it in one chart.
Measures of center and spread are the first chapter of every statistics course, and the foundation for confidence intervals, hypothesis tests and A/B testing. Introduction to Statistics (Stanford) covers them clearly and conceptually. See also how averages are misused visually in 5 Data Visualization Mistakes, and browse all Math & Statistics courses.
Is the median better than the mean? Neither is better in general. The median better describes a typical value in skewed data. The mean is needed for totals and many statistical methods. Choose based on the question.
Why do salary reports use the median? Because salaries are right-skewed. A few very high earners pull the mean well above what most people earn, so the median is a more honest picture of a typical salary.
Can data have no mode or several modes? Yes. If every value is unique, there's no meaningful mode. Data with two peaks is bimodal, which often means two different populations are mixed together.
How do I calculate these in Excel or Python?
In Excel: AVERAGE, MEDIAN and MODE.SNGL. In pandas: df["col"].mean(), .median() and .mode().
The mean is the right choice for totals and symmetric data. The median is the honest choice for the "typical" case in skewed data full of outliers. The mode is for the most common category. When the mean and median disagree, don't pick the one that suits your argument. Look at the distribution, report the measure that matches the question, and add a measure of spread.