Choosing the right graph, and 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.
- 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.
Which graph should you draw?
- It feels like a matter of taste. It is not.
- The kind of data you have decides it.
- Choose wrongly and the graph cannot answer the question.

Categories get a bar graph
- Walk, bus, car, bike: these are groups, not numbers.
- One bar per group, height is how many.
- The bars have gaps, because the groups are separate.

Try it: the same counts, three graphs
Measurements get a dot plot
- When each value is a number on a scale.
- One dot each, stacked over its value.
- Now you can see the shape of the data.

Two categories at once
- Now split each group by year level.
- Two variables about the same students.
- There are two ways to draw that.
| Graph | Looks like | Good for |
|---|---|---|
| Clustered | bars side by side | compare the parts |
| Stacked | bars on top of each other | read the total |
Clustered: side by side
- Two bars in each group, one per year level.
- Easy to compare the two directly.
- Year 8 takes the bus more than Year 7.

Stacked: one on top of the other
- Exactly the same numbers.
- Now each bar is the total for that group.
- 21 people walk, and you can read that instantly.

So which of those two?
- This is the one genuine choice in the topic.
- Comparing the two year levels? Clustered.
- Comparing the totals? Stacked.
| Graph | Looks like | Good for |
|---|---|---|
| Clustered | bars side by side | compare the parts |
| Stacked | bars on top of each other | read the total |
Measured over time
- One thing measured again and again.
- Time along the bottom, the measurement up the side.
- Join the points, because they follow on.

This one does not start at zero
- The temperatures run from 17 to 23.
- Drawn from zero it would be a flat line at the top.
- And the day-to-day change would vanish.

The whole decision, in one table
- Look at what kind of data you have.
- The graph follows from that.
- There is only one real choice in the list.
| Data | Graph | Example |
|---|---|---|
| Categories, one variable | bar graph | favourite sport |
| Measurements, one variable | dot plot | shoe sizes |
| Two categories paired | clustered or stacked bar | transport by year |
| Measured over time | time-series graph | daily temperature |
What every graph must carry
- A reader who did not collect the data needs telling.
- What it is about, what each axis is, what the units are.
- And who it was collected from.
| Needs | So a reader knows |
|---|---|
| A title | what the graph is about |
| Axis labels | what each axis measures |
| Units | mm, °C, students |
| A scale | starting where it says it starts |
| Who from | 61 students at one school, one week |
Missing parts hide things
- A graph with no units could be millimetres or metres.
- A scale not starting at zero can exaggerate a difference.
- Sometimes careless. Sometimes deliberate.
| Needs | So a reader knows |
|---|---|
| A title | what the graph is about |
| Axis labels | what each axis measures |
| Units | mm, °C, students |
| A scale | starting where it says it starts |
| Who from | 61 students at one school, one week |
One dot a long way from the rest
- Six days between 0 and 3 mm of rain.
- Then one day with 46.
- That is an outlier.

It pulls the mean towards itself
- The mean for the week is 7.6 mm.
- Six of the seven days had less than 3.
- The median is 1 mm, which describes the week better.

Try it: pull the tail
But it is not a mistake
- 46 mm is a real storm. It really rained.
- Deleting it would hide the most important day.
- An outlier is a thing to explain, not to remove.
| What you do | Result | |
|---|---|---|
| Delete it | the week looks dry | dishonest |
| Keep it, report both | mean 7.6, median 1 | honest |
| Say what happened | one storm on Friday | best |
How to report it honestly
- Give both summaries: mean 7.6, median 1.
- Then say what happened: a storm on the Friday.
- That is a finding, not an inconvenience.
| Fact | Value | Note |
|---|---|---|
| Six ordinary days | 0 to 3 mm | |
| Friday | 46 mm | a real storm |
| Mean for the week | 53 ÷ 7 | 7.6 mm |
| Median | the middle day | 1 mm |
When it IS worth checking
- A height of 1700 cm is not a tall person.
- That one is a decimal point in the wrong place.
- Ask whether the value is possible, not whether it is tidy.
| Value | Possible? | So |
|---|---|---|
| 46 mm of rain | yes, a storm | keep it |
| 1700 cm tall | no | check the record |
| A test score of 105 out of 100 | no | check the record |
Common mistakes
- Favourite sport: I drew a time-series graph and joined the points.Favourite sport is categorical, so it needs a bar graph with gaps; only measurements over time get joined points.
- 46 mm is an outlier, so I deleted it before finding the mean.An outlier like a real storm is data to explain, not remove; report the mean and the median and say what happened.
- I used a stacked bar graph to compare Year 7 and Year 8 in each group.Stacked shows totals; to compare the two year levels side by side, use a clustered bar graph.
- My graph shows the bars but has no title, axis labels or units.A reader needs the variable, the units and who the data came from, so every graph needs a title and labelled axes.
Your turn: eight questions
- Try all eight.
- For 1 and 2, name the data type first.
- The graph follows from that.
You record favourite sport for 30 students. Which graph?
You record the noon temperature every day for a fortnight. Which graph?
Name the outlier in 4, 5, 5, 6, 7, 38. Does it raise or lower the mean?
A graph has no axis labels. What can a reader not tell?
You measure the hand span of 25 students in centimetres. Which graph?
You count students at each lunch spot, split into Year 7 and Year 8. You want to read each spot's total. Which graph?
Which recorded value should be checked as a likely error?
Whanganui rain for a week, in mm: 2, 0, 1, 3, 51, 2, 1. What should you do with the 51?
Show answer
1. A bar graph. Favourite sport is categorical. 2. A time-series graph, because it is one measurement repeated over time. 3. 38. It is far above the rest, so it drags the mean up: the other five run 4 to 7, but the mean of all six is 10.8. 4. What is being measured, and in what units. The shape of the graph tells you nothing without them. 5. A dot plot, because hand span is a measurement on a scale, one value per student. 6. A stacked bar graph, because each bar then shows the total for that spot at a glance. 7. A student height of 1600 cm. No person is 16 metres tall, so it is probably a decimal point in the wrong place; the others are possible. 8. Keep it and explain it. 51 mm is a real storm, so deleting it would hide the most important day.
The answers
- Favourite sport is categorical, so a bar graph.
- Temperature over a fortnight is a time series.
- 38 is the outlier and it raises the mean to 10.8.
| Answer | |
|---|---|
| 1 | bar graph |
| 2 | time-series graph |
| 3 | 38; it raises the mean |
| 4 | what is measured, and in what units |
What to take away
- The data type chooses the graph, not you.
- Stacked for totals, clustered to compare the parts.
- An outlier is usually real. Explain it, do not delete it.
| Remember | |
|---|---|
| The data type | chooses the graph; you do not |
| Categories | bar graph. Measurements: dot plot |
| Over time | time-series graph |
| Stacked or clustered | total at a glance, or compare the parts |
| An outlier | is usually real: explain it, do not delete it |
Challenge
A weather station at Milford Sound recorded the rainfall on 8 days in a row. The mean for the 8 days was 12 mm. Leaving out the wettest day, the mean of the other 7 days was only 4 mm. (a) How much rain fell on the wettest day? (b) The other seven readings were 2, 3, 5, 0, 6, 4 and 8 mm. Find the median of all 8 days. (c) Which kind of graph should show the 8 days, and should the wettest day be removed from it? Explain.
Hint
A mean tells you the total: mean × number of days. Compare the total for 8 days with the total for the other 7.
Answer
(a) 68 mm. (b) The median is 4.5 mm. (c) A time-series graph, because it is one measurement taken day after day. The wettest day must stay: it is a real outlier (a storm), so report both the mean of 12 mm and the median of 4.5 mm and say what happened.
Step by step
- The 8 days hold 8 × 12 = 96 mm of rain in total.
- The other 7 days hold 7 × 4 = 28 mm.
- So the wettest day had 96 − 28 = 68 mm.
- Sorted, the 8 readings are 0, 2, 3, 4, 5, 6, 8, 68, so the median is halfway between 4 and 5.
- Rain measured day after day is a time series. An outlier is explained, not deleted.
Full working
- 8 × 12 = 96total rain over 8 days
- 7 × 4 = 28total rain on the other 7 days
- 96 − 28 = 68the wettest day
- Check: 2 + 3 + 5 + 0 + 6 + 4 + 8 = 28matches the 7-day total
- 0, 2, 3, 4, 5, 6, 8, 68sorted, the middle two are 4 and 5
- (4 + 5) ÷ 2 = 4.5median
- (a) 68 mm, (b) median 4.5 mm, (c) time-series graph, keep the storm day and report mean 12 mm and median 4.5 mm
Every student in Room 12 and Room 14 at a Porirua school was asked where their lunch comes from: home, the free school lunch, or the canteen. On a stacked bar graph the three bars (home, school lunch, canteen) have totals 21, 24 and 15. On a clustered bar graph of the same data, Room 14's school-lunch bar is twice as tall as Room 12's, and Room 12's home bar is 4 taller than Room 12's canteen bar. Room 12 has 28 students. (a) Find all six numbers, and how many students are in Room 14. (b) Which room has the larger fraction of students bringing lunch from home? (c) Which graph, stacked or clustered, would you show the principal to compare the two rooms, and which to show how many lunches the canteen must make?
Hint
Start with the school-lunch bar: Room 12's part and Room 14's part make 24, and one is twice the other. Then use Room 12's total of 28.
Answer
(a) Room 12: home 12, school lunch 8, canteen 8. Room 14: home 9, school lunch 16, canteen 7, so Room 14 has 32 students. (b) Room 12: 12 out of 28 is 37, about 43%, against 9 out of 32 for Room 14, about 28%. (c) Clustered to compare the rooms; stacked to read the canteen total of 15.
Step by step
- Room 12's school lunches plus twice that make 24, so Room 12 has 8 and Room 14 has 16.
- Room 12 has 28 students, so its home and canteen numbers add to 20.
- Home is 4 more than canteen, so canteen is 8 and home is 12.
- Room 14's home is 21 − 12 = 9 and its canteen is 15 − 8 = 7.
- Compare fractions, not counts, because the rooms are different sizes.
Full working
- Room 12 school lunch + 2 × itself = 24, so 3 parts = 24the stacked bar total
- Room 12: 8, Room 14: 16school lunch
- 28 − 8 = 20Room 12 home + canteen
- (20 − 4) ÷ 2 = 8 canteen, 8 + 4 = 12 homehome is 4 taller
- Room 14 home: 21 − 12 = 9; canteen: 15 − 8 = 7from the stacked totals
- 9 + 16 + 7 = 32Room 14's size
- 1228 = 37 ≈ 43% and 932 ≈ 28%fraction bringing lunch from home
- Room 14 has 32 students; Room 12 has the larger share from home; clustered for the comparison, stacked for the canteen total
A time-series graph shows the number of kererū counted at a Waikato reserve each year from 2019 to 2025. From 2019 to 2021 the count went up by 4 each year. In 2022 a storm left a count of only 2. In 2023 the count was back to exactly the 2021 count, and from 2023 to 2025 it again went up by 4 each year. The mean of the seven counts is 26. (a) Find all seven counts. (b) Find the median. (c) Find the mean of the six years without 2022. (d) Explain why the mean of all seven is below the median, and say how a report should treat 2022.
Hint
Call the 2019 count the starting count. Write every other year as the starting count plus something. The seven counts must add to 7 × 26.
Answer
(a) 22, 26, 30, 2, 30, 34, 38. (b) Median 30. (c) Mean 30. (d) The low outlier of 2 pulls the mean down towards itself, but not the median. 2022 is a real event, so keep it on the graph, report both the mean and the median, and say a storm caused it.
Step by step
- The seven counts must total 7 × 26 = 182.
- Written from the 2019 count: 2019 is the start, 2020 is start + 4, 2021 is start + 8, 2023 is start + 8, 2024 is start + 12, 2025 is start + 16, and 2022 is 2.
- Take away the 2 and the extras 4, 8, 8, 12 and 16: 182 − 2 − 48 = 132, shared between six equal starting counts.
- 132 ÷ 6 = 22, so 2019 had 22 kererū.
- Sorted the counts are 2, 22, 26, 30, 30, 34, 38, so the median is the 4th, 30.
- Without 2022 the total is 180 over 6 years, a mean of 30.
Full working
- 7 × 26 = 182total of all seven counts
- 4 + 8 + 8 + 12 + 16 = 48extra above the 2019 count in the other years
- 182 − 2 − 48 = 132six copies of the 2019 count
- 132 ÷ 6 = 22the 2019 count
- 22, 26, 30, 2, 30, 34, 38the counts for 2019 to 2025
- Sorted: 2, 22, 26, 30, 30, 34, 38median is the 4th value, 30
- (182 − 2) ÷ 6 = 30mean without 2022
- Counts 22, 26, 30, 2, 30, 34, 38; median 30; mean without 2022 is 30; the outlier drags the mean down to 26
Where science uses this
Practise this
Report a mistake
More in Statistics
Is your child on track?
Take the free placement test

