Skip to content

Measures of Center

In this lesson you’ll learn to compute the mean, median, and mode, understand which one resists outliers, and know which to report for a given shape of data. “Average” is ambiguous, and this lesson is about being precise instead.

The mean is the total divided by the count.

xˉ=xn\bar{x} = \frac{\sum x}{n}

Read the top as “add up every value” and the bottom as “how many there are.”

For 4, 7, 9, 12:

xˉ=4+7+9+124=324=8\bar{x} = \frac{4 + 7 + 9 + 12}{4} = \frac{32}{4} = 8

The mean is the balance point of the data. If you put the values on a seesaw, the mean is where it balances. That’s a useful mental image, because it explains the mean’s weakness: a single value far out on one end tilts the whole thing.

The median is the middle value when the data is sorted.

  1. Sort the values.
  2. If nn is odd, the median is the middle one, at position n+12\frac{n+1}{2}.
  3. If nn is even, average the two middle values.

For 3, 7, 8, 11, 15 (five values): the middle is the 3rd, so the median is 8.

For 3, 7, 8, 11 (four values): average the middle two, 7+82=7.5\frac{7+8}{2} = 7.5.

You must sort first. Forgetting to sort is the single most common median error.

The median is a positional measure. It only cares about rank, not magnitude, which is exactly why it shrugs off extreme values.

The mode is the most frequently occurring value.

For 2, 3, 3, 5, 7, 7, 7, 9: the mode is 7.

A dataset can have:

  • One mode (unimodal)
  • Two modes (bimodal) if two values tie for most frequent
  • No mode if every value appears exactly once

The mode is the only measure of center that works for categorical data. The “average” favorite color is meaningless, but the most common one isn’t.

An outlier is a value far from the rest. How each measure handles one is the practical heart of this lesson.

Take five salaries: 40k, 45k, 50k, 55k, 60k.

xˉ=250,0005=50,000median=50,000\bar{x} = \frac{250{,}000}{5} = 50{,}000 \qquad \text{median} = 50{,}000

Now the boss joins with a 1 million salary:

xˉ=1,250,0006=208,333median=50,000+55,0002=52,500\bar{x} = \frac{1{,}250{,}000}{6} = 208{,}333 \qquad \text{median} = \frac{50{,}000 + 55{,}000}{2} = 52{,}500

The mean more than quadrupled. The median moved by 5%.

The mean is sensitive to outliers; the median is resistant (or robust). Saying “the average salary here is 208k” is technically true and deeply misleading, since five of the six people earn a quarter of that.

The relationship between mean and median tells you the shape:

  • Symmetric - mean ≈ median. Either one works; the mean is more common because it uses all the information.
  • Right-skewed - mean > median. The tail pulls the mean up. Report the median.
  • Left-skewed - mean < median. Report the median.

The rule of thumb: the mean gets dragged toward the tail. So whichever measure is more extreme points to where the tail is.

When to use each:

  • Mean - symmetric quantitative data, and any time you need the total (total payroll is n×xˉn \times \bar{x}).
  • Median - skewed data, or data with outliers. Income, house prices, response times.
  • Mode - categorical data, or when you want the most typical single value.

When values carry different importance, weight them:

xˉw=(wx)w\bar{x}_w = \frac{\sum (w \cdot x)}{\sum w}

A course grade where homework is 30%, midterm 30%, final 40% is a weighted mean. So is a GPA, weighted by credit hours.

Example 1: All three measures.

Data: 12, 15, 11, 15, 18, 20, 15, 13

Solution.

Sort first: 11, 12, 13, 15, 15, 15, 18, 20

Mean:

xˉ=11+12+13+15+15+15+18+208=1198=14.875\bar{x} = \frac{11+12+13+15+15+15+18+20}{8} = \frac{119}{8} = 14.875

Median: n=8n = 8 is even, so average positions 4 and 5, both 15:

median=15+152=15\text{median} = \frac{15+15}{2} = 15

Mode: 15 appears three times, more than any other. Mode = 15.

All three cluster near 15, which suggests a roughly symmetric distribution.

Example 2: The outlier effect.

Seven house prices in thousands: 180, 195, 210, 220, 235, 250, 4000.

Solution.

xˉ=180+195+210+220+235+250+40007=52907755.7\bar{x} = \frac{180+195+210+220+235+250+4000}{7} = \frac{5290}{7} \approx 755.7

Median: n=7n = 7 is odd, so position 7+12=4\frac{7+1}{2} = 4, giving 220.

The mean says 756k, but six of the seven houses cost under 251k. Only the mansion is anywhere near the mean, and nothing is at it.

The median of 220 describes a typical house. The mean describes nothing that exists. This is why real estate always reports medians.

Example 3: Median with an even count.

Data: 7, 3, 9, 4, 8, 6

Solution. Sort: 3, 4, 6, 7, 8, 9

n=6n = 6, so average the 3rd and 4th values:

median=6+72=6.5\text{median} = \frac{6 + 7}{2} = 6.5

Note the median doesn’t have to be a value that appears in the data.

Example 4: Weighted mean.

A course grades homework 20%, two midterms 25% each, and the final 30%. A student scores 95 on homework, 78 and 84 on midterms, 88 on the final.

Solution.

xˉw=(0.20)(95)+(0.25)(78)+(0.25)(84)+(0.30)(88)\bar{x}_w = (0.20)(95) + (0.25)(78) + (0.25)(84) + (0.30)(88) =19+19.5+21+26.4=85.9= 19 + 19.5 + 21 + 26.4 = 85.9

The weights already sum to 1, so no division is needed. Note the unweighted mean of the four scores would be 86.25, slightly different, because the weights shift emphasis toward the heavier midterms.

Example 5: Working backward from a mean.

Nine students averaged 82 on a test. A tenth student takes it and the average rises to 83. What did the tenth student score?

Solution. The first nine scored a total of 9×82=7389 \times 82 = 738.

For ten students to average 83, the total must be 10×83=83010 \times 83 = 830.

830738=92830 - 738 = 92

The tenth student scored 92. This works because the mean and the total are interchangeable: total=n×xˉ\text{total} = n \times \bar{x}.

Example 6: Which to report?

A company’s 100 employees have a mean salary of 95k and a median of 62k. Which should the recruiting page show, and what does the gap tell you?

Solution. The mean far exceeds the median, so the distribution is strongly right-skewed. A small number of executives earn enough to lift the mean 33k above the middle.

The median of 62k is the honest figure for “what would I likely earn.” Advertising the 95k mean is a well-known way to be truthful and deceptive at once.

Income and wealth statistics are the flagship case. Mean household wealth in many countries is several times the median, because wealth distributions have extraordinarily long right tails. Any argument built on mean wealth is describing a country that mostly doesn’t exist, which is why economists work with medians and percentiles.

Salary negotiations turn on this. “Average salary for this role” could be a mean inflated by a few senior outliers. Asking for the median, or better the range and quartiles, gets you a usable number.

Server performance monitoring abandoned the mean entirely. Engineers track p50, p95, and p99 latency (the median and high percentiles) because mean response time hides the slow requests that actually annoy users. A mean of 100ms is consistent with most requests taking 50ms and a few taking 5 seconds.

Sports averages are means and inherit the weakness. One extraordinary game can lift a season average enough to obscure typical performance, which is part of why advanced metrics report distributions.

Real estate, as noted, is median by convention. So is the standard reporting of home price indices, precisely because a few luxury sales would otherwise swamp the signal.

Find the median of 14, 9, 21, 6, 17.
Which measure of center is most resistant to outliers?
A dataset has a mean of 71 and a median of 84. What shape is the distribution?
Eight people have a mean age of 30. A ninth person joins and the mean becomes 32. How old is the ninth person?
Which measure of center can be used with categorical data such as favorite ice cream flavor?