Shape, mean and median · Statistics & Data Science… | StemPy Lab
Course 2.1·Lesson 3 of 3
Shape, mean and median
The mean is the balance point of the data, and the median is the middle value. For a symmetric distribution they are close. A long tail pulls the mean towards it, while the median hardly moves. This lesson uses that fact to read the shape from the two averages, and to choose the average that describes a typical value.
about 30 min1 simulation1 practice question1 Python program6 questions to check yourself
This lesson is free to read. Enroll free to keep your place and take the tests.
Lesson 3 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
predict whether the mean or the median is larger from the shape of a distribution;
read a likely shape from the mean and the median;
choose the better average for a typical value, and explain your choice.
Nine workers and their pay
A small workshop has nine workers. This is made-up data. Their monthly pay, in thousands, is
18,20,21,22,22, 24,25,28,90.
The owner is the worker paid 90. The mean pay is 9270=30 thousand. The median, the middle of the nine sorted values, is 22 thousand. Eight of the nine workers earn less than the mean. Which number tells a new worker what to expect? The median does. The single value of 90 pulled the mean up. The median only cares about the order, so it stayed with the crowd.
Why the tail wins
You met both averages in First Steps. Here is how they react to a tail.
The mean uses the size of every value. It is the balance point of the data. A value far out on one side is like a heavy child sitting at the end of a seesaw: the balance point must move towards it.
The median uses only the order. Make the largest value larger still, and the middle value does not change.
So the averages give a clue to the shape.
Shape
Usually
symmetric
mean ≈ median
skewed right
mean > median
skewed left
mean < median
The word "usually" matters. This is a rule of thumb for clear shapes, not a law. A data set with a few repeated values can break it. When the two averages are close, look at a histogram before you name a shape.
Here is the rule in a picture. For the 30 journey times of the first lesson, the tail goes to the right, the mean is 20.4 minutes and the median is 17.5 minutes.
A histogram of the 30 journey times with bins 5 minutes wide, from 0 to 55 minutes. The bars rise to a peak at 15 to 20 minutes and then fall slowly into a long tail to the right, which an arrow labels. A dashed green line marks the median at 17.5 minutes, and a solid red line to its right marks the mean at 20.4 minutes.
You should find that the median stays at 15 whatever you do, while the mean follows the tail. Stretch the top three values by 20 and the mean climbs above 26. Pull the smallest value down instead, and the mean drops below the median.
Which average to report?
For a symmetric distribution, report the mean. It uses every value, and it is close to the median anyway.
For a skewed distribution, or one with outliers, report the median. It describes a typical value better. This is why news reports give the median house price and the median income.
For categories, such as favourite colours, only the mode makes sense.
Both averages are worth giving when they differ a lot. The gap between them tells your reader that the data is skewed. You can meet the exam version of the three averages, with grouped data, in the Maths course on Centre and Spread of Data.
Practise with new numbers
Try it in Python
The program finds the mean and the median of the nine pay values with the statistics module, and counts how many workers earn less than the mean.
Common mistakes
Reporting the mean of skewed data as typical. A few large values make it too high.
Treating the rule of thumb as a law. Check a histogram when the mean and the median are close.
Forgetting to sort before finding the median.
Thinking the median ignores the data. It uses every value to find the order, but not their sizes.
Remember these
A long tail pulls the mean towards it. The median hardly moves.
Usually: skewed right means mean > median; skewed left means mean < median.
Report the median for skewed data or data with outliers, and the mean for symmetric data.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
The values 2,3,3,4,5, 6,26 are listed. Find the mean and the median. Which describes a typical value better?
For a data set, the mean is 54 and the median is 41. What shape is likely?
A test was easy, and most students scored between 80 and 100 out of 100. A few scored below 30. Which is larger, the mean or the median?
Every value of a data set is increased by 10. What happens to the mean and to the median?
A company says that the average salary of its staff is high. Which average would you ask for, and why?
References
OpenStax, Introductory Statistics, Chapter 2 (Descriptive Statistics), sections on measures of the centre of the data and on skewness and the mean, median and mode.
Enroll free in Histograms and the Shape of Data
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.