Prices, location and spread
Prices, location and spread

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

Free course

Prices, location and spread

1.4 The mean and median compared

Both the mean and median of a batch are useful indicators of the location of the values in the batch. They are, however, calculated in very different ways. To find the median you must first order the batch of data, and if you are not using a computer, you will often do the sorting by means of a stemplot. On the other hand, the major step in finding the mean consists of summing the values in the batch, and for this they do not need to be ordered.

For large batches, at least when you are not using a computer, it is often much quicker to sum the values in the batch than it is to order them. However, for small batches, like some of those you will be analysing in this course without a computer, it can be just as fast to calculate the median as it is to calculate the mean. Moreover, placing the batch values in order is not done solely to help calculate the median – there are many other uses. Drawing a stemplot to order the values also enables us to examine the general shape of the batch. In Section 3 you will read about some other uses of the stemplot.

Comparisons based on the method of calculation can be of great practical interest, but the rest of this subsection will consider more fundamental differences between the mean and the median – differences which should influence you when you are deciding which measure to use in summarising the general location of the values in a batch.

Many of the problems with the mean, as well as some advantages, lie in the fact that the precise value of every item in the batch enters into its calculation. In calculating the median, most of the data values come into the calculation only in terms of whether they are in the 50% above the median value or the 50% below it. If one of them changes slightly, but without moving into the other half of the batch, the median will not change. In particular, if the extreme values in the batch are made smaller or larger, this will have no effect on the value of the median – the median is resistant to outliers. In contrast, changes to the extremes could have an appreciable effect on the value of the mean, as the following examples show.

Example 5 Changing the extreme coffee prices

For the batch of coffee prices in Figure 1 (Subsection 1.2), the sum of the values is 4363p, so the mean is

fraction 4363 p over 15 end simeq 290.9 p .

Suppose the highest and lowest coffee prices are reduced so that

x subscript open bracket 1 close bracket end = 240 and x subscript open bracket 15 close bracket end = 340.

The median of this altered batch is the same as before, 295p. However, the sum of the values is now 4306p and so the mean is

fraction 4306 p over 15 end simeq 287.1 p .

Example 6 Changing the small television prices

Suppose the highest two television prices in Activity 1 (Subsection 1.2) are altered to £350 and £400. The median, at £150, remains the same as that of the original batch, whereas the new mean is

fraction pounds 3470 over 20 end = pounds 173.5 simeq pounds 174

compared with the original mean of £162.

Now, even with the very high prices of £350 and £400 for two televisions, the overall location of the main body of the data is still much the same as for the original batch of data. For the original batch the mean, £162, was a reasonably good measure of this. However, for the new batch the mean, £174, is much too high to be a representative measure since, as we can see from the stemplot in Activity 1, most of the values are below £174.

Example 6 is the subject of the following screencast. [Note that the reference to ‘Unit 2’ should be ‘this course’. Unit 2 is a reference to the Open University course from which this material is adapted.]

Download this video clip.Video player: Effects on the median and mean when data points change
Skip transcript: Screencast 1 Effects on the median and mean when data points change

Transcript: Screencast 1 Effects on the median and mean when data points change

INSTRUCTOR: In this screencast, I’m going to talk about calculating the mean and the median from the stemplot and showing how the mean and the median change when some of the data changes. So I’m going to start off with a stemplot. And the stemplot I’ve got here is a stemplot of the prices of the small flat screen televisions that are shown in Activity 1 in Subsection 1.2 of Unit 2.

And the first thing I’m going to do is calculate the median. And we note first that we’ve got 20 data points in our batch. And so the median is the average of the 10th and 11th largest values.

So it’s just a question of finding out from the stemplot what the 10th and the 11th largest values are. And we can do that by counting down from the top value in our stemplot. That’s 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11.

But we could also have counted from the bottom of the stemplot. Again, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11. And notice, it’s come at the same two numbers, as it should. So for these data, the median is 150 plus 150 over 2, which is £150, taking into account this key for this stemplot.

Now the mean is just the sum of all the numbers divided by the number of numbers. And going through stemplot, we can write down what all the numbers are. So the lowest number is 90. The next one is 100. Next one is 120. And so on, so forth, until we get to 240 and 250 and 270.

And that’s all divided by the number of numbers, which is 20. And the sum on top of the fraction happens to be 3240. That’s divided by 20, and that comes to £162. So the mean of the television prices is £162, and the median is £150. So the mean is £12 bigger than the median.

Now, what happens if some of the data changes? For example, what happens if a couple of the prices for the televisions goes up? And in particular, what happens if the prices of the most expensive televisions go up? So instead of having a television that costs £250 and a television that costs £270, we actually had a couple of televisions that cost £350 and £400? What difference does this make to the median and the mean?

Well, notice that the two values we work the median out from haven’t changed. So we can just write that down immediately. The median is £150, just as it was before.

So what about the mean? Well again, we’ve got to work out the sum of all the data points and divide by the number of numbers. For most of the numbers, they haven’t changed. So most the numbers in the sum don’t change. But the last two have – so instead of 250, we’ve now got 350, and instead of 270, we’ve got 400. Again, that’s divided by 20. That’s equal to 3470 over 20, which equals 173.5, or we can say that’s £174 to the nearest pound.

So what we notice here that when the data is changed, the median has stayed the same. We say that the median is a resistant measure. It’s been resistant to a change in the data. On the other hand, the mean is bigger. We say that the mean is a sensitive measure. It has been sensitive to changes in the data.

End transcript: Screencast 1 Effects on the median and mean when data points change
Screencast 1 Effects on the median and mean when data points change
Interactive feature not available in single page view (see it in standard view).

A measure which is insensitive to changes in the values near the extremes is called a resistant measure.

The median is a resistant measure whereas the mean is sensitive.

In the following activities, you can investigate some other ways in which the median is more resistant than the mean.

Activity 4 Changing the gas prices

In Activity 2 (Subsection 1.2) you may have noticed that Cardiff and Ipswich had rather low gas prices compared to the other southern cities. Here you are going to examine the effect of deleting them from the batch of southern cities. Complete the following table and comment on your results.

BatchMeanMedian

Seven southern cities

 

Five southern cities (excluding Cardiff and Ipswich)

Discussion

The completed table is:

BatchMeanMedian

Seven southern cities

3.7859

3.795

Five southern cities (excluding Cardiff and Ipswich)

3.7996

3.796

Whereas deletion of Cardiff and Ipswich has the effect of increasing the mean price by 0.0137p per kWh, the median price increases by only 0.001p per kWh. This is what we would expect as, in general, the more resistant a measure is, the less it changes when a few extreme values are deleted.

Activity 5 A misprint in the gas prices

Suppose the value for London had been misprinted as 8.318 instead of 3.818 (quite an easy mistake to make!). How would this affect your results for the batch of five southern cities (again omitting Cardiff and Ipswich)?

BatchMeanMedian

Five cities (correct data)

Five cities (with misprint)

Discussion

The completed table is:

BatchMeanMedian

Five cities (correct data)

3.7996

3.796

Five cities (with misprint)

4.6996

3.796

Here the median is completely unaffected by the misprint, although the mean changes considerably.

Suppose you wanted to use these values – the correct ones, of course – to estimate the average price of gas over the whole country. The simple arithmetic mean of the 14 values given in Table 3 (Subsection 1.2) would not allow for the fact that much more gas is consumed in London, at a relatively high price, than in other cities. To take account of this you would need to calculate what is known as a weighted arithmetic mean. Weighted means are the subject of Section 2.

M140_1

Take your learning further

Making the decision to study can be a big step, which is why you'll want a trusted University. The Open University has 50 years’ experience delivering flexible learning and 170,000 students are studying with us right now. Take a look at all Open University courses.

If you are new to University-level study, we offer two introductory routes to our qualifications. You could either choose to start with an Access module, or a module which allows you to count your previous learning towards an Open University qualification. Read our guide on Where to take your learning next for more information.

Not ready for formal University study? Then browse over 1000 free courses on OpenLearn and sign up to our newsletter to hear about new free courses as they are released.

Every year, thousands of students decide to study with The Open University. With over 120 qualifications, we’ve got the right course for you.

Request an Open University prospectus371