Vertex Learn

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

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 seeWhich isFrom the
What was measuredthe variableaxis label
Who it came fromthe group studiedtitle
In what unitsfor numerical dataaxis label
How much of itthe frequencythe scale
Key idea

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?
MissingYou cannot tell
Titlewho was studied
Axis labelwhat was measured
Unitswhether it is cm or m
Scalehow big the differences are
Key idea

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.
TrickEffect
Axis not starting at 0small differences look huge
No scale at allnothing can be checked
No sample sizeyou cannot judge the evidence
Key idea

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.
Categorical data gets a bar graph
Key idea

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.
A few numerical values get a dot plot
Key idea

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.
DataExampleChart
Categoricalfavourite sportbar graph
A few numerical valuesfoot lengths of 6 peopledot plot
Two categorical at onceyear group and transportclustered or stacked
Something over timetemperature each monthtime-series graph
Worked example

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.
Two categories at once: clustered
Key idea

Try it: change the counts

Worked example

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.
The same data, stacked
Key idea

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.
ChartWhat it doesGood for
Clusteredbars side by sidecompares the parts
Stackedbars on top of each othershows the total
Same datadifferent question answered
Key idea

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.
And things over time get a line
Key idea

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.
DataOrdered?Join the points?
Monthsyesyes
Favourite sportnono
Foot lengthsnot a sequenceno
Key idea

Try it: let the data choose

Key idea

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.
Now: a value that does not belong
Worked example

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.
DataMeanMedian
4, 5, 5, 6, 5mean 5median 5
4, 5, 5, 6, 30mean 10median 5
Key idea

Try it: add an outlier

Worked example

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.
DataMeanMedian
4, 5, 5, 6, 5mean 5median 5
4, 5, 5, 6, 30mean 10median 5
The meandoubled
The mediandid not move
Key idea

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.
MeasureUsesSo
The meanuses every valueso a big one drags it
The medianonly uses positionso size does not matter
Change 30 to 300mean moves againmedian still 5
Key idea

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 itis it a typo or a mis-measurement?
If it is realkeep it, and say so
Report bothmean and median, when they disagree
Neverquietly 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

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.
1

Which graph suits the favourite sport of 30 students?

2

In 4, 5, 5, 6, 30, name the outlier and its effect.

3

Name three things every graph must have.

4

Clustered or stacked, to compare Year 7 with Year 8 directly?

5

You want a graph of the number of siblings of 12 students that shows every individual value. Which graph?

6

A bar graph comparing two shops' sales starts its vertical axis at 90 instead of 0. What is the effect?

7

Why are the points on a graph of Auckland's temperature each month joined, but the bars of a favourite sport graph not?

8

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.

Worked example

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
1bar graph
230, mean 5 to 10
3title, labels, scale
4clustered
Summary

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 datachooses the graph, not your drawing speed
Every graphneeds a title, axis labels and a scale
Clusteredcompares parts; stacked shows totals
An outlierdrags the mean and leaves the median alone
And it isnot automatically an error

Challenge

1

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
  1. 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.
  2. To compare popularity, use the share of each year group: divide each count by the size of the year group.
  3. Year 7: walk 40%, bus 30%, car 20%, bike 10%. Year 8: walk 30%, bus 37.5%, car 25%, bike 7.5%.
  4. So Year 8 has the bigger share only for bus and car.
  5. For walking to reach 40% of 80, Year 8 needs 32 walkers, which is 8 more than now.
Full working
  1. Year 7 walk: 20 ÷ 50 = 0.4 = 40%share of its own year
  2. Year 8 walk: 24 ÷ 80 = 0.3 = 30%(a) a smaller share, despite the taller bar
  3. Year 7: bus 15 ÷ 50 = 30%, car 10 ÷ 50 = 20%, bike 5 ÷ 50 = 10%the other shares
  4. Year 8: bus 30 ÷ 80 = 37.5%, car 20 ÷ 80 = 25%, bike 6 ÷ 80 = 7.5%(b) bus and car are bigger
  5. 40% of 80 = 32(c) walkers Year 8 would need
  6. 32 − 24 = 8(c) students who must switch
  7. (a) 40% against 30%, so walking is less popular in Year 8; (b) bus and car; (c) 8 students
2

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
  1. 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.
  2. So the other report, $900,000, used the mean. It is above six of the seven prices because the beachfront sale pulls it up.
  3. 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.
  4. With the eighth house the total is $6,950,000, so the mean is 6,950,000 ÷ 8 = $868,750.
  5. 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.
  6. 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
  1. order: 560, 600, 620, 640, 660, 700, beachfrontprices in thousands of dollars
  2. 4th of 7 = 640(a) the median, whatever the beachfront price is
  3. so $640,000 is the median and $900,000 is the mean(a)
  4. 7 × 900,000 = 6,300,000(b) total of all seven
  5. 560 + 600 + 620 + 640 + 660 + 700 = 3,780 thousandthe six ordinary houses
  6. 6,300,000 − 3,780,000 = 2,520,000(b) the beachfront price
  7. 6,300,000 + 650,000 = 6,950,000; 6,950,000 ÷ 8 = 868,750(c) new mean
  8. middle two: 640,000 and 650,000, median = 645,000(c) new median
  9. mean down 900,000 − 868,750 = 31,250; median up 645,000 − 640,000 = 5,000(c) the mean moved more
  10. (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
3

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
  1. The ten values add to 43, so with the new student the total is 43 + x and the mean is (43 + x) ÷ 11.
  2. 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.
  3. That needs 43 + x to be at least 77, so x is at least 34.
  4. 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.
  5. 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.
  6. The one outlier dragged the mean up to 7, the second highest value in the class, while the median stayed at 4.
Full working
  1. 2 + 3 + 3 + 4 + 4 + 4 + 5 + 5 + 6 + 7 = 43total of the ten
  2. mean = (43 + x) ÷ 11with the eleventh student
  3. (43 + x) ÷ 11 ≥ 7the 7 hours student must not be above the mean
  4. 43 + x ≥ 77, so x ≥ 34(a) smallest x is 34
  5. x = 33: mean = 76 ÷ 11 ≈ 6.9 < 733 is too small
  6. x = 34: mean = 77 ÷ 11 = 7(b) only 34 is above 7
  7. 2, 3, 3, 4, 4, 4, 5, 5, 6, 7, 34: median = 6th value = 4(b) eleven values
  8. (a) x = 34; (b) mean 7 hours, median 4 hours, the median is more typical; (c) keep her dot

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