Unit 2, lesson 6

Mean, Median, Mode and Weighted Averages

How the mean, median and mode measure the center of data, why the mean is a balance point, why the median resists extreme values, and how a weighted mean combines groups of different sizes.

  • Video 6
  • Center, Spread and Position

Five constructed purchases cost 2, 3, 4, 5 and 16 dollars. Asked for a typical purchase, one person answers 6 and another answers 4, and both have done the arithmetic correctly. They have answered different questions, one about spreading the total evenly and one about the middle purchase. This lesson defines the mean, median and mode, explains the mean as a balance point and the median’s resistance to extreme values, and shows how to combine group averages without misweighting the groups.

Key terms

Mean

Definition The mean of numerical observations x1,…,xnx_1, \dots, x_n is their sum divided by their number. For a sample it is the sample mean

xˉ=1n∑i=1nxi,\bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i ,

and the same calculation over all NN members of a defined population gives the population mean μ\mu. The mean needs values for which adding and dividing make sense, such as measurements and counts, and not codes that merely name categories. Multiplying the mean by the number of observations recovers the total, nxˉ=∑i=1nxin\bar{x} = \sum_{i=1}^{n} x_i.

In plain words The mean is the equal share. If the total were split evenly among the observations, each would receive the mean.

Example For the five purchases,

xˉ=2+3+4+5+165=305=6.\begin{aligned} \bar{x} &= \frac{2 + 3 + 4 + 5 + 16}{5} \\[0.4em] &= \frac{30}{5} = 6. \end{aligned}

The total of 30 dollars, spread evenly, gives 6 dollars per purchase, even though four of the five purchases cost less than 6. If these five are every purchase in the week being studied, 6 is the population mean μ\mu for that week. If they are a sample from a larger set of purchases, 6 is the sample mean xˉ\bar{x}, and any statement about the larger set depends on how the sample was chosen.

Balance point

Definition The deviations of the observations from their mean add to zero,

∑i=1n(xi−xˉ)=∑i=1nxi−nxˉ=0.\begin{aligned} \sum_{i=1}^{n} (x_i - \bar{x}) &= \sum_{i=1}^{n} x_i - n\bar{x} \\[0.4em] &= 0. \end{aligned}

For any number cc the sum of deviations ∑i=1n(xi−c)\sum_{i=1}^{n} (x_i - c) equals n(xˉ−c)n(\bar{x} - c), so the mean is the only number from which the deviations add to zero. If each observation is an equal weight placed on a number line, the line balances at xˉ\bar{x}, which is why the mean is called the balance point of the data.

In plain words The distances below the mean exactly cancel the distances above it. A value far from the rest sits on a long lever arm, so it pulls the balance point toward itself.

Example For the purchases with mean 6, the deviations are −4-4, −3-3, −2-2, −1-1 and 1010. The four negative deviations add to −10-10 and cancel the single positive deviation. The one large purchase balances all four small ones, which is why the mean lies above four of the five values. In data with a long right tail the mean is often pulled above the median, as it is here, but that ordering is a tendency rather than a rule, so check it in each data set.

Median

Definition To find the median of nn observations, sort them from smallest to largest. If nn is odd, the median is the value in position (n+1)/2(n + 1)/2. If nn is even, the convention used here takes the midpoint of the two middle values, those in positions n/2n/2 and n/2+1n/2 + 1. In both cases at least half of the observations are less than or equal to the median, and at least half are greater than or equal to it. The median needs only an ordering, so it also applies to ordered categories such as ratings, as long as the middle position, or both middle positions, fall in one category.

In plain words The median is the middle of the sorted list. At least half of the data lie at or below it, and at least half lie at or above it.

Example The sorted purchases 2, 3, 4, 5 and 16 have n=5n = 5, so the median is the third value, 4. Without the 16, the list 2, 3, 4 and 5 has n=4n = 4, and the median is the midpoint of the second and third values,

3+42=3.5.\frac{3 + 4}{2} = 3.5.

A median of an even number of values need not be one of the observed values.

Mode

Definition The mode of a data set is the value or category that occurs most often. If several values tie for the highest frequency, each of them is a mode. If two or more observations all have different values, every value ties, and some texts then say the data have no mode. Either way the mode singles out no value in that case. The mode needs only counting, so of the three centers it is the only one that applies to categories with no natural order. For grouped numerical data, the bin with the highest frequency density is called the modal bin.

In plain words The mode is the most common answer. It is the natural center for categories such as ways of traveling, where a mean or a median of category labels would mean nothing.

Example If 12 students travel by bus, 8 walk and 5 cycle, the mode is bus. The data 2, 3, 3, 4 and 18 have mode 3, because 3 occurs twice and every other value occurs once. The purchases 2, 3, 4, 5 and 16 have no repeated value, so their mode does not pick out a typical purchase.

Weighted mean

Definition For values x1,…,xkx_1, \dots, x_k with nonnegative weights w1,…,wkw_1, \dots, w_k whose sum is positive, the weighted mean is

xˉw=∑i=1kwixi∑i=1kwi.\bar{x}_w = \frac{\sum_{i=1}^{k} w_i x_i}{\sum_{i=1}^{k} w_i}.

Equal weights give the ordinary mean. To combine groups, take the group means as the values and the group sizes as the weights. Each product wixiw_i x_i is then the total of group ii, so the weighted mean is the mean of all individuals pooled together. The plain average of the group means is a different quantity, the mean that gives every group equal weight. For two groups it equals the pooled mean exactly when the groups have equal sizes or equal means. Other weights, such as credit hours or survey weights, express other targets, so the weights should always be stated.

In plain words A weighted mean lets some values count more than others. When the values are group averages and the question is about people, the right weights are the numbers of people.

Example A group of 10 people has mean 6 and a group of 30 people has mean 10. The pooled mean of all 40 people is

xˉw=10⋅6+30⋅1010+30=36040=9.\begin{aligned} \bar{x}_w &= \frac{10 \cdot 6 + 30 \cdot 10}{10 + 30} \\[0.4em] &= \frac{360}{40} = 9. \end{aligned}

The plain average (6+10)/2=8(6 + 10)/2 = 8 treats the groups as if they had equal sizes. It understates the mean of the 40 people, because the larger group has the higher mean.

Resistance

Definition A summary is resistant if changing a small part of the data, even to extremely large or small values, can move it only a limited amount. The median is resistant. If more than half of the observations stay unchanged, the median stays between the smallest and the largest unchanged observation, however far the other observations move. The mean is not resistant. Changing one observation by an amount dd changes the mean by d/nd/n, which can be as large as you like.

In plain words The median depends on positions in the sorted list, so extreme values that make up less than half of the data cannot drag it outside the range of the other values. The mean uses the size of every value, so one extreme value can drag it anywhere. Resistance does not mean that the median never changes.

Example Changing the purchase of 16 dollars to 36 dollars raises the total by 20 and the mean by 20/5=420/5 = 4, from 6 to 10, while the median stays at 4. Changing instead the two smallest purchases, 2 and 3, to 20 and 30 gives the data 4, 5, 16, 20 and 30, whose median is 16. The median moved, but three of the five values were unchanged, and the new median lies between the smallest and the largest of them, 4 and 16. For skewed spending, the median describes a typical purchase, while the mean is the right summary for planning a total, since the total is nxˉn\bar{x}.

Check yourself

  1. Find the mean, median and mode of 1, 2, 2, 3, 4 and 12. How many values lie below the mean, and which center better describes a typical value?
Show the answer

The sum is 24, so the mean is 24/6=424/6 = 4. With n=6n = 6 the median is the midpoint of the third and fourth sorted values, (2+3)/2=2.5(2 + 3)/2 = 2.5. The value 2 occurs twice and every other value once, so the mode is 2.

Four of the six values lie below the mean, because the single value 12 pulls it up. For a typical value the median 2.52.5 is the better summary here. The mean is still the right number for a question about the total, since 6×4=246 \times 4 = 24.

  1. A course has two sections. The 12 students in section 1 average 70 points, and the 28 students in section 2 average 80 points. Find the mean score of all 40 students. A report gives 75. What did the report compute, and when would that number be correct?
Show the answer

The section totals are 12⋅70=84012 \cdot 70 = 840 and 28⋅80=224028 \cdot 80 = 2240 points, so the mean over all students is

840+224040=308040=77.\frac{840 + 2240}{40} = \frac{3080}{40} = 77.

The report’s 75 is the plain average of the two section means, which weights the sections equally. That is the right answer to a question about the average section, but not about the average student. It would equal the mean of all students if the sections had equal sizes or equal means. Here the larger section has the higher mean, so the pooled mean is above 75.

  1. A survey records each student’s main way of traveling with the codes 1 for bus, 2 for walk and 3 for cycle. Among 25 students, 12 take the bus, 8 walk and 5 cycle, and a summary reports a mean travel code of 1.721.72. Explain what is wrong and give a center that is meaningful.
Show the answer

The codes are labels, so adding or averaging them has no meaning, even though the arithmetic 43/25=1.7243/25 = 1.72 is correct. With the codes 1 for cycle, 2 for bus and 3 for walk, the same answers give a mean of 53/25=2.1253/25 = 2.12, so the result depends on an arbitrary choice. The median has the same problem. With the first coding the 13th sorted code is 2, which is walk, and with the second coding it is 2, which is bus.

The mode, bus, uses only the counts 12, 8 and 5 and does not depend on the codes, so it is the meaningful center for this variable.

How this lesson connects