Vertex Learn

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.
Key idea

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.
Which graph should you draw?
Key idea

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.
Categories get a bar graph
Key idea

Try it: the same counts, three graphs

Key idea

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.
Measurements get a dot plot
Key idea

Two categories at once

  • Now split each group by year level.
  • Two variables about the same students.
  • There are two ways to draw that.
GraphLooks likeGood for
Clusteredbars side by sidecompare the parts
Stackedbars on top of each otherread the total
Key idea

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.
Clustered: side by side
Key idea

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.
Stacked: one on top of the other
Key idea

So which of those two?

  • This is the one genuine choice in the topic.
  • Comparing the two year levels? Clustered.
  • Comparing the totals? Stacked.
GraphLooks likeGood for
Clusteredbars side by sidecompare the parts
Stackedbars on top of each otherread the total
Key idea

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.
Measured over time
Key idea

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.
This one does not start at zero
Key idea

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.
DataGraphExample
Categories, one variablebar graphfavourite sport
Measurements, one variabledot plotshoe sizes
Two categories pairedclustered or stacked bartransport by year
Measured over timetime-series graphdaily temperature
Key idea

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.
NeedsSo a reader knows
A titlewhat the graph is about
Axis labelswhat each axis measures
Unitsmm, °C, students
A scalestarting where it says it starts
Who from61 students at one school, one week
Key idea

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.
NeedsSo a reader knows
A titlewhat the graph is about
Axis labelswhat each axis measures
Unitsmm, °C, students
A scalestarting where it says it starts
Who from61 students at one school, one week
Key idea

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.
One dot a long way from the rest
Key idea

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.
It pulls the mean towards itself
Key idea

Try it: pull the tail

Key idea

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 doResult
Delete itthe week looks drydishonest
Keep it, report bothmean 7.6, median 1honest
Say what happenedone storm on Fridaybest
Worked example

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.
FactValueNote
Six ordinary days0 to 3 mm
Friday46 mma real storm
Mean for the week53 ÷ 77.6 mm
Medianthe middle day1 mm
Key idea

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.
ValuePossible?So
46 mm of rainyes, a stormkeep it
1700 cm tallnocheck the record
A test score of 105 out of 100nocheck 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

Your turn: eight questions

  • Try all eight.
  • For 1 and 2, name the data type first.
  • The graph follows from that.
1

You record favourite sport for 30 students. Which graph?

2

You record the noon temperature every day for a fortnight. Which graph?

3

Name the outlier in 4, 5, 5, 6, 7, 38. Does it raise or lower the mean?

4

A graph has no axis labels. What can a reader not tell?

5

You measure the hand span of 25 students in centimetres. Which graph?

6

You count students at each lunch spot, split into Year 7 and Year 8. You want to read each spot's total. Which graph?

7

Which recorded value should be checked as a likely error?

8

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.

Worked example

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
1bar graph
2time-series graph
338; it raises the mean
4what is measured, and in what units
Summary

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 typechooses the graph; you do not
Categoriesbar graph. Measurements: dot plot
Over timetime-series graph
Stacked or clusteredtotal at a glance, or compare the parts
An outlieris usually real: explain it, do not delete it

Challenge

1

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
  1. The 8 days hold 8 × 12 = 96 mm of rain in total.
  2. The other 7 days hold 7 × 4 = 28 mm.
  3. So the wettest day had 96 − 28 = 68 mm.
  4. Sorted, the 8 readings are 0, 2, 3, 4, 5, 6, 8, 68, so the median is halfway between 4 and 5.
  5. Rain measured day after day is a time series. An outlier is explained, not deleted.
Full working
  1. 8 × 12 = 96total rain over 8 days
  2. 7 × 4 = 28total rain on the other 7 days
  3. 96 − 28 = 68the wettest day
  4. Check: 2 + 3 + 5 + 0 + 6 + 4 + 8 = 28matches the 7-day total
  5. 0, 2, 3, 4, 5, 6, 8, 68sorted, the middle two are 4 and 5
  6. (4 + 5) ÷ 2 = 4.5median
  7. (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
2

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
  1. Room 12's school lunches plus twice that make 24, so Room 12 has 8 and Room 14 has 16.
  2. Room 12 has 28 students, so its home and canteen numbers add to 20.
  3. Home is 4 more than canteen, so canteen is 8 and home is 12.
  4. Room 14's home is 21 − 12 = 9 and its canteen is 15 − 8 = 7.
  5. Compare fractions, not counts, because the rooms are different sizes.
Full working
  1. Room 12 school lunch + 2 × itself = 24, so 3 parts = 24the stacked bar total
  2. Room 12: 8, Room 14: 16school lunch
  3. 28 − 8 = 20Room 12 home + canteen
  4. (20 − 4) ÷ 2 = 8 canteen, 8 + 4 = 12 homehome is 4 taller
  5. Room 14 home: 21 − 12 = 9; canteen: 15 − 8 = 7from the stacked totals
  6. 9 + 16 + 7 = 32Room 14's size
  7. 1228 = 37 ≈ 43% and 932 ≈ 28%fraction bringing lunch from home
  8. Room 14 has 32 students; Room 12 has the larger share from home; clustered for the comparison, stacked for the canteen total
3

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
  1. The seven counts must total 7 × 26 = 182.
  2. 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.
  3. Take away the 2 and the extras 4, 8, 8, 12 and 16: 182 − 2 − 48 = 132, shared between six equal starting counts.
  4. 132 ÷ 6 = 22, so 2019 had 22 kererū.
  5. Sorted the counts are 2, 22, 26, 30, 30, 34, 38, so the median is the 4th, 30.
  6. Without 2022 the total is 180 over 6 years, a mean of 30.
Full working
  1. 7 × 26 = 182total of all seven counts
  2. 4 + 8 + 8 + 12 + 16 = 48extra above the 2019 count in the other years
  3. 182 − 2 − 48 = 132six copies of the 2019 count
  4. 132 ÷ 6 = 22the 2019 count
  5. 22, 26, 30, 2, 30, 34, 38the counts for 2019 to 2025
  6. Sorted: 2, 22, 26, 30, 30, 34, 38median is the 4th value, 30
  7. (182 − 2) ÷ 6 = 30mean without 2022
  8. Counts 22, 26, 30, 2, 30, 34, 38; median 30; mean without 2022 is 30; the outlier drags the mean down to 26

More challenge problems

Science

Where science uses this

Practice

Practise this

Worksheet with answersWithout answersDownload PDF
Report a mistake

More in Statistics

Is your child on track?

Take the free placement test