Mean, Median, Mode & Standard Deviation
The four numbers that summarise any dataset. Here's what each means, how to calculate it, and — most importantly — when to use which.
For the dataset [3, 7, 7, 9, 12]: Mean = (3+7+7+9+12)/5 = 7.6. Median = middle value = 7. Mode = most frequent = 7. Range = 12−3 = 9. Standard deviation ≈ 2.94 (measures spread). Use median for skewed data like salaries; mean for symmetric data like test scores.
Mean (Average)
Formula: Mean = Sum of all values ÷ Count of values
Example: test scores [72, 85, 91, 68, 94]
- Add all values: 72 + 85 + 91 + 68 + 94 = 410
- Divide by count (5): 410 ÷ 5 = 82
Weakness: A single outlier skews the mean dramatically. Add one score of 0 → mean drops to 68.3.
Median (Middle Value)
Odd count: Sort values, pick the middle one. Even count: Sort, average the two middle values.
Example: salaries [$30k, $200k, $35k, $40k, $45k]
- Sort: $30k, $35k, $40k, $45k, $200k
- Count = 5 (odd). Middle position = 3rd. Median = $40k
- Mean = ($30k + $35k + $40k + $45k + $200k) ÷ 5 = $70k — misleading!
The median ($40k) is more representative. Government income statistics always report median for this reason.
Mode (Most Frequent Value)
The mode is the value that appears most often. There can be no mode, one mode, or multiple modes.
Examples:
- [1, 2, 3, 3, 4, 5] → Mode = 3
- [2, 4, 4, 6, 8, 8] → Bimodal: Mode = 4 and 8
- [1, 2, 3, 4, 5] → No mode (all appear once)
- Shoe sizes sold: [38, 40, 42, 42, 42, 44] → Mode = 42 (most popular — useful for inventory!)
Standard Deviation (Spread)
Standard deviation measures how spread out values are from the mean. Small SD = values clustered near the mean. Large SD = values spread wide.
Steps (population SD):
- Find the mean.
- Subtract the mean from each value, then square the result.
- Find the average of those squared differences (this is the variance).
- Take the square root of the variance.
Sample SD: divide by (n − 1) in step 3, not n. Use sample SD when your data is a sample from a larger population (which is almost always).
| Measure | Use when | Real-world example |
|---|---|---|
| Mean | Data is symmetric, no outliers | Average temperature over a month |
| Median | Data is skewed or has outliers | Median household income, median house price |
| Mode | Most frequent value matters | Most popular product size, most common response |
| Std Dev | Measuring variability or risk | Investment portfolio volatility, exam score consistency |