Choosing a graph, and spotting outliers
What this lesson covers
- Categorical data can be visualised through dot plots and bar graphs.
- Paired categorical variables can be visualised through a stacked bar graph or a clustered bar graph.
- Bivariate time-series data can be visualised through a time-series graph.
- A good data visualisation should allow viewers to discern the variable or variables and who the data was collected from, and then additional information such as units, frequency, proportions, patterns, and trends.
- Outliers are individual data points that are very much bigger or smaller than most of the data points.
- Outliers skew the mean value for a data set towards themselves, but not the median value.
- Outliers are not necessarily an error, as there are some events that occur rarely in many situations.
A graph is an argument, not a decoration
- You draw one so a reader can see something at a glance.
- Which means the reader has to be able to tell what it shows.
- Get that wrong and the graph is worse than the table was.
| The reader must see | Which is | From the |
|---|---|---|
| What was measured | the variable | axis label |
| Who it came from | the group studied | title |
| In what units | for numerical data | axis label |
| How much of it | the frequency | the scale |
Which is why labels are not optional
- A graph with no title: who is this data about?
- No axis label: what was measured, and in what?
- No scale: is that bar twice the other, or barely bigger?
| Missing | You cannot tell | |
|---|---|---|
| Title | who was studied | |
| Axis label | what was measured | |
| Units | whether it is cm or m | |
| Scale | how big the differences are |
And a missing label can be deliberate
- A bar chart starting at 90 instead of 0 exaggerates everything.
- Sometimes that is carelessness. Sometimes it is not.
- If you cannot check a graph, do not trust its conclusion.
| Trick | Effect | |
|---|---|---|
| Axis not starting at 0 | small differences look huge | |
| No scale at all | nothing can be checked | |
| No sample size | you cannot judge the evidence |
Categorical data gets a bar graph
- Favourite sport, eye colour, how you get to school.
- One bar per category, height is how many.
- The bars can go in any order, because the groups do not.

A few numerical values get a dot plot
- One dot per measurement, stacked where they repeat.
- You can see every individual value, which a bar graph hides.
- Best when there are not too many of them.

The data chooses, not you
- Look at what kind of variable you have first.
- Categorical, numerical, two variables, or something over time.
- Each one has a chart that fits it. Pick that one.
| Data | Example | Chart |
|---|---|---|
| Categorical | favourite sport | bar graph |
| A few numerical values | foot lengths of 6 people | dot plot |
| Two categorical at once | year group and transport | clustered or stacked |
| Something over time | temperature each month | time-series graph |
Two categories at once: clustered
- Now split each group by year level as well.
- Two bars per category, side by side.
- You can compare Year 7 against Year 8 directly.

Try it: change the counts
The same data, stacked
- Now put the two on top of each other instead.
- The bar height is the total for that category.
- Walking is clearly the biggest overall. That was hidden before.

So they answer different questions
- Clustered compares the two parts against each other.
- Stacked shows the total for each category.
- Neither is better. Ask what your question was.
| Chart | What it does | Good for |
|---|---|---|
| Clustered | bars side by side | compares the parts |
| Stacked | bars on top of each other | shows the total |
| Same data | different question answered |
And things over time get a line
- Time goes along the bottom, always.
- Join the points, because the order means something.
- That is a time-series graph, and it shows trends.

Why you join those and not the bars
- Months come in an order, and there is time between them.
- The line says something happened between the points.
- Categories have no order, so joining them would be nonsense.
| Data | Ordered? | Join the points? |
|---|---|---|
| Months | yes | yes |
| Favourite sport | no | no |
| Foot lengths | not a sequence | no |
Try it: let the data choose
Now: a value that does not belong
- Take 4, 5, 5, 6 and 5. Nothing surprising there.
- Change the last one to 30 and look at the plot.
- That is an outlier: far bigger than everything else.

It drags the mean with it
- Before: the five values added to 25, so the mean was 5.
- After: they add to 50, so the mean is 10.
- One value changed, and the mean doubled.
| Data | Mean | Median |
|---|---|---|
| 4, 5, 5, 6, 5 | mean 5 | median 5 |
| 4, 5, 5, 6, 30 | mean 10 | median 5 |
Try it: add an outlier
But the median does not move
- Sorted, the middle value was 5 before.
- Sorted, the middle value is 5 after.
- Exactly the same. The median never noticed.
| Data | Mean | Median |
|---|---|---|
| 4, 5, 5, 6, 5 | mean 5 | median 5 |
| 4, 5, 5, 6, 30 | mean 10 | median 5 |
| The mean | doubled | |
| The median | did not move |
Because of what each one uses
- The mean adds every value, so a huge one pulls hard.
- The median only cares which value sits in the middle.
- Change the 30 to 300 and the median is still 5.
| Measure | Uses | So |
|---|---|---|
| The mean | uses every value | so a big one drags it |
| The median | only uses position | so size does not matter |
| Change 30 to 300 | mean moves again | median still 5 |
And an outlier is not automatically wrong
- Check it. It might be a typo, or a mis-measurement.
- But rare things do happen, and then it is real data.
- If it is real, keep it and say so. Never quietly delete it.
| Step | ||
|---|---|---|
| Check it | is it a typo or a mis-measurement? | |
| If it is real | keep it, and say so | |
| Report both | mean and median, when they disagree | |
| Never | quietly delete it |
Common mistakes
- Changing 4, 5, 5, 6, 5 to 4, 5, 5, 6, 30 pushes the median up too.The median stays at 5 while the mean jumps from 5 to 10: an outlier pulls the mean, not the median.
- An outlier is a mistake, so I deleted it.Outliers can be real, rare events; check whether it is an error before removing it, and say what you did.
- Favourite sport drawn as a line graph joining the points.Favourite sport is categorical, so use a bar graph; a line joining points is for something over time.
- Starting the axis at 90 makes the bars easier to compare.A bar graph's axis should start at 0; starting at 90 makes small differences look huge.
Your turn: eight questions
- Try all eight.
- Question 2 wants a number and an effect, not just the number.
- Question 4 turns on what is being compared.
Which graph suits the favourite sport of 30 students?
In 4, 5, 5, 6, 30, name the outlier and its effect.
Name three things every graph must have.
Clustered or stacked, to compare Year 7 with Year 8 directly?
You want a graph of the number of siblings of 12 students that shows every individual value. Which graph?
A bar graph comparing two shops' sales starts its vertical axis at 90 instead of 0. What is the effect?
Why are the points on a graph of Auckland's temperature each month joined, but the bars of a favourite sport graph not?
Year 8 times for 100 m run from 14 to 17 seconds, but one is 41 seconds. What should you do with the 41?
Show answer
1. A bar graph. Favourite sport is categorical, so there is nothing to measure along an axis. 2. 30. It doubles the mean from 5 to 10 and leaves the median at 5. 3. A title saying who the data is about, labels on both axes including units, and a scale. 4. Clustered. The bars sit side by side, so you compare the two year groups directly. Stacked would show you each total instead. 5. A dot plot. It puts one dot per student, so every value can be seen, which a bar graph hides. 6. Small differences look much bigger than they are. Cutting off the bottom of every bar exaggerates the gap between them. 7. Months have an order, and favourite sports do not. A line says something happened between the points, which only makes sense in time. 8. Check it; if it is real, keep it and say so. An outlier may be a typo, but rare things happen, so never quietly delete it.
The answers
- Favourite sport is categorical, so a bar graph.
- 30 is the outlier. It doubles the mean and leaves the median.
- Title, axis labels with units, and a scale. And clustered.
| Answer | |
|---|---|
| 1 | bar graph |
| 2 | 30, mean 5 to 10 |
| 3 | title, labels, scale |
| 4 | clustered |
What to take away
- Look at the data first. It decides which graph you draw.
- An outlier drags the mean and leaves the median where it was.
- And it is not automatically an error, so never just delete it.
| Remember | |
|---|---|
| The data | chooses the graph, not your drawing speed |
| Every graph | needs a title, axis labels and a scale |
| Clustered | compares parts; stacked shows totals |
| An outlier | drags the mean and leaves the median alone |
| And it is | not automatically an error |
Challenge
A Napier school surveys how students get to school. Year 7 (50 students): walk 20, bus 15, car 10, bike 5. Year 8 (80 students): walk 24, bus 30, car 20, bike 6. A clustered bar graph shows the Year 8 walking bar taller than the Year 7 one, and Mere says: 'Walking is more popular in Year 8.' (a) Explain why Mere is wrong. (b) For which ways of travelling does Year 8 have the bigger share? (c) If some Year 8 car travellers switched to walking, how many would have to switch for walking to be as popular in Year 8 as in Year 7?
Hint
The two year groups are different sizes, so compare fractions of each year group, not counts. Turn each count into a percentage of its own year.
Answer
(a) Year 8 is a bigger group. 20 out of 50 Year 7s walk (40%), but only 24 out of 80 Year 8s (30%), so walking is less popular in Year 8. (b) Bus (37.5% against 30%) and car (25% against 20%). (c) 8 students, making 32 out of 80 walkers, which is 40%.
Step by step
- A clustered bar graph of counts compares numbers of students, and Year 8 has 30 more students, so its bars tend to be taller anyway.
- To compare popularity, use the share of each year group: divide each count by the size of the year group.
- Year 7: walk 40%, bus 30%, car 20%, bike 10%. Year 8: walk 30%, bus 37.5%, car 25%, bike 7.5%.
- So Year 8 has the bigger share only for bus and car.
- For walking to reach 40% of 80, Year 8 needs 32 walkers, which is 8 more than now.
Full working
- Year 7 walk: 20 ÷ 50 = 0.4 = 40%share of its own year
- Year 8 walk: 24 ÷ 80 = 0.3 = 30%(a) a smaller share, despite the taller bar
- Year 7: bus 15 ÷ 50 = 30%, car 10 ÷ 50 = 20%, bike 5 ÷ 50 = 10%the other shares
- Year 8: bus 30 ÷ 80 = 37.5%, car 20 ÷ 80 = 25%, bike 6 ÷ 80 = 7.5%(b) bus and car are bigger
- 40% of 80 = 32(c) walkers Year 8 would need
- 32 − 24 = 8(c) students who must switch
- (a) 40% against 30%, so walking is less popular in Year 8; (b) bus and car; (c) 8 students
Seven houses sold on a Mount Maunganui street last year. Six of the prices were $560,000, $600,000, $620,000, $640,000, $660,000 and $700,000. The seventh, a beachfront house, sold for far more than any of the others. Two news reports gave the 'average' price on the street: one said $640,000 and the other said $900,000. (a) Without finding the seventh price, explain which report used the median and which used the mean. (b) Find the seventh price. (c) An eighth house on the street then sells for $650,000. Find the new mean and median. Which one changed more, and why? (d) Write one honest sentence for a family hoping to buy an ordinary house on the street.
Hint
On a dot plot the beachfront house sits far to the right of the other six. Where does that put the middle one of the seven? For (b), the mean tells you the total of all seven prices.
Answer
(a) The beachfront price is the largest, so in order it comes last and the middle (4th) price is $640,000 whatever it is. So $640,000 is the median and $900,000 is the mean. (b) $2,520,000. (c) Mean $868,750, median $645,000. The mean fell by $31,250 but the median rose by only $5,000: the mean shares out the beachfront price over every house, so one more ordinary sale pulls it a long way, while the median only shifts to halfway between the two middle prices. (d) For example: most houses on the street sold for between $560,000 and $700,000, with a median of $645,000; the mean of about $869,000 is pulled up by one beachfront sale of $2.52 million.
Step by step
- In order, the seven prices are 560, 600, 620, 640, 660, 700 (thousand dollars) and then the beachfront price. The 4th is $640,000 however big the beachfront price is, so that report used the median.
- So the other report, $900,000, used the mean. It is above six of the seven prices because the beachfront sale pulls it up.
- A mean of $900,000 for seven houses means a total of $6,300,000. The six ordinary houses add to $3,780,000, so the beachfront house sold for $2,520,000.
- With the eighth house the total is $6,950,000, so the mean is 6,950,000 ÷ 8 = $868,750.
- Eight prices in order: 560, 600, 620, 640, 650, 660, 700, 2,520 (thousand dollars). The median is halfway between 640 and 650, which is $645,000.
- The outlier is a real sale, not a mistake, so it stays in the data. But a family looking for an ordinary house should be told the median and the spread of the ordinary prices.
Full working
- order: 560, 600, 620, 640, 660, 700, beachfrontprices in thousands of dollars
- 4th of 7 = 640(a) the median, whatever the beachfront price is
- so $640,000 is the median and $900,000 is the mean(a)
- 7 × 900,000 = 6,300,000(b) total of all seven
- 560 + 600 + 620 + 640 + 660 + 700 = 3,780 thousandthe six ordinary houses
- 6,300,000 − 3,780,000 = 2,520,000(b) the beachfront price
- 6,300,000 + 650,000 = 6,950,000; 6,950,000 ÷ 8 = 868,750(c) new mean
- middle two: 640,000 and 650,000, median = 645,000(c) new median
- mean down 900,000 − 868,750 = 31,250; median up 645,000 − 640,000 = 5,000(c) the mean moved more
- (a) $640,000 is the median, $900,000 the mean; (b) $2,520,000; (c) mean $868,750, median $645,000, the mean changed more
Ten Year 8 students in a Taupō class recorded how many hours of sport they play each week, and drew a dot plot: 2, 3, 3, 4, 4, 4, 5, 5, 6, 7. An eleventh student, who trains with a national rowing squad, joins the class. She plays x hours a week, where x is a whole number bigger than 7. (a) Find the smallest value of x for which she is the only one of the eleven students who plays more than the mean. (b) For that value of x, find the mean and the median of the eleven values. Which one describes a typical student in the class better? (c) Someone suggests leaving her dot off the plot so that the scale can stop at 10. Should they?
Hint
The mean is the total divided by 11, and the total depends on x. For nobody else to be above the mean, the student who plays 7 hours must not be above it. Write that as an inequality.
Answer
(a) x = 34. (b) Mean 7 hours, median 4 hours. The median describes a typical student better: ten of the eleven students play 7 hours or less, and six of them play 4 hours or less. (c) No. Her 34 hours is real data about a rare kind of student, not a mistake. Keep her dot, stretch the scale (or mark a break in it), and say in the report that one student trains with a national squad.
Step by step
- The ten values add to 43, so with the new student the total is 43 + x and the mean is (43 + x) ÷ 11.
- The biggest of the other values is 7. For her to be the only one above the mean, 7 must not be above the mean, so (43 + x) ÷ 11 must be at least 7.
- That needs 43 + x to be at least 77, so x is at least 34.
- Check x = 33: the mean is 76 ÷ 11, about 6.9, so the student who plays 7 hours is also above the mean. Check x = 34: the mean is 77 ÷ 11 = 7 exactly, and only 34 is above it.
- In order the eleven values are 2, 3, 3, 4, 4, 4, 5, 5, 6, 7, 34. The 6th is 4, so the median is 4 hours.
- The one outlier dragged the mean up to 7, the second highest value in the class, while the median stayed at 4.
Full working
- 2 + 3 + 3 + 4 + 4 + 4 + 5 + 5 + 6 + 7 = 43total of the ten
- mean = (43 + x) ÷ 11with the eleventh student
- (43 + x) ÷ 11 ≥ 7the 7 hours student must not be above the mean
- 43 + x ≥ 77, so x ≥ 34(a) smallest x is 34
- x = 33: mean = 76 ÷ 11 ≈ 6.9 < 733 is too small
- x = 34: mean = 77 ÷ 11 = 7(b) only 34 is above 7
- 2, 3, 3, 4, 4, 4, 5, 5, 6, 7, 34: median = 6th value = 4(b) eleven values
- (a) x = 34; (b) mean 7 hours, median 4 hours, the median is more typical; (c) keep her dot


