mastree

Choosing a graph, scaling it, and lines of best fit

What this lesson covers

  • A distribution is formed from all the possible values of a variable and their frequencies. It can be shown using data visualisations that show patterns, trends, and variations and that include dot plots, bar graphs, frequency tables, box plots, histograms, time-series graphs, scatter plots, and two-way tables.
  • A good data visualisation should allow viewers to discern the variable(s) and who the data was collected from, and then, depending on the type of visualisation, additional information such as frequency, proportions, patterns or trends, and units for numerical variables.
  • In relationship investigations: sometimes one variable is thought of as predictive of the other variable; then the response or dependent variable is on the y-axis, and the ‘predictive’, explanatory, or independent variable is on the x-axis an eyeballed line or curve of best fit can be added for paired numerical data.
Key idea

A graph is an argument

  • A list of numbers tells you almost nothing at a glance.
  • A graph of the same numbers can be read in a second.
  • Which means choosing the graph is part of the argument.
Key idea

What a distribution is

  • Every value that occurs, and how often each one occurs.
  • That is all the word means.
  • A graph of it shows shape, spread and gaps at once.
TermMeaning
A distributionevery value that occurs
Andhow often each one does
A graph of itshows shape, spread and gaps
Which a list of numbersdoes not
Key idea

The graphs available to you

  • Bar graphs and two-way tables handle categories.
  • Dot plots, histograms and box plots handle one numerical variable.
  • Time series handle change, and scatter plots handle pairs.
ForUseOr
Categoriesbar graphtwo-way table
One numerical variabledot plothistogram, box plot
Over timetime-series graph
Two variables togetherscatter plot
Key idea

Two questions pick the graph

  • What kind of variable is it: a category or a number?
  • What am I trying to show: a shape, a trend, or a link?
  • Those two answers choose for you. Not "which can I draw".
AskThen
What kind of variable?category or number
What am I showing?a shape, a trend, a link
Those two answerspick the graph for you
Not "which can I draw"
Worked example

Categories go in bars

  • Favourite sport is a category, so the bars are the sports.
  • The height of each bar is how many people chose it.
  • The order of the bars carries no meaning. You can rearrange them.
Categories go in bars
Worked example

One numerical variable goes in a dot plot

  • Each dot is one measurement, stacked where it falls.
  • Now the shape is visible: where it clusters, where it thins out.
  • And the summaries can be drawn straight onto it.
One numerical variable goes in a dot plot
Key idea

What a reader has to be able to work out

  • What was measured, and in what units.
  • Who it was measured on. Which students, which year, where.
  • Without those, a graph is a shape rather than evidence.
Must showWhereNote
What is measuredaxis labels
Who it is abouta title or caption
The unitson the numerical axis
Without thoseit is a shapenot evidence
Worked example

The same two numbers, drawn twice

  • Ninety-six and ninety-eight. About two percent apart.
  • On an axis from zero, the bars look almost identical. True.
  • On an axis from ninety, one looks a third taller. Also true.
DrawnLooks likeHonest?
Two values, 96 and 98about 2% apart
Axis from 0the bars look aliketrue
Axis from 90one looks a third talleralso true
Nothing is falseand the reader is fooled
Key idea

Try it: same numbers, new scale

Key idea

So where should an axis start?

  • For bar charts, at zero, because the length is the comparison.
  • Line graphs and scatter plots may start elsewhere.
  • But label it clearly, so nobody is misled by accident.
ChartRule
Bar chartsstart the axis at zero
Because a bar’s lengthis the comparison
Line and scatter plotsmay start elsewhere
But say so clearlyon the axis
Key idea

Nothing on that chart was false

  • Every number was right. The bars were drawn correctly.
  • And every reader took away the wrong impression.
  • That is how most misleading graphs work. Not by lying.
Key idea

Two variables, and which goes where

  • The one you think does the affecting goes across the bottom.
  • The one that responds goes up the side.
  • Hours studied across, test score up. It is a convention worth keeping.
VariableCalledGoes
Explanatory variablethe one you think causesx-axis
Response variablethe one that answersy-axis
Hours studiedexplanatoryacross
Test scoreresponseup
Worked example

A scatter plot

  • Each point is one person, measured on both variables.
  • Six students, their study hours and their scores.
  • The points do not lie on a line, and they do have a direction.
A scatter plot
Key idea

Fitting a line by eye

  • Draw a straight line through the middle of the cloud.
  • Roughly as many points above it as below.
  • Not joining the dots, and not bending to reach any of them.
DoDetail
Draw through the middleof the cloud of points
Roughly as many aboveas below
Not joining the dotsand not through every point
Then read predictionsoff the line
Key idea

Try it: drag the points

Worked example

Predicting from it, and the limit

  • Seven hours: go up to the line, then across. About 85.
  • Inside the range of your data that is reasonably safe.
  • A long way outside it, the line is a guess wearing a ruler.
ReadingConfidenceNote
At 7 hoursread up to the lineabout 85
Inside the datareasonably safe
Far outside itthe line may not hold
A line is a summarynot a law
Key idea

Try it: fit a line, then predict

Summary

What to take away

  • Seven lines, and the sixth one is the one to remember.
A distributionthe values and how often each occurs
Categoriesbar graph
One numerical variabledot plot or histogram
Two variablesscatter plot
A reader needswhat, who, and the units
A truncated axismisleads without lying
A line of best fitgoes through the middle, not the dots

Common mistakes

  • Favourite sport of 200 students goes on a dot plot.
    Favourite sport is a category, so use a bar graph; a dot plot is for one numerical variable.
  • Test score goes across the bottom and hours of sleep up the side.
    The explanatory variable, hours of sleep, goes on the x-axis; the response, test score, goes up the side.
  • My line of best fit joins each point to the next one.
    Draw one straight line through the middle of the cloud, with roughly as many points above it as below.
  • Start the bar chart's axis at 90 so the difference between 96 and 98 shows up.
    Bar charts start at zero because bar length is the comparison; from 90, a 2% gap looks like a third.
Your turn

Your turn: eight questions

  • Answer all eight.
  • Question 2 is asking which variable explains which.
  • Question 4 wants a number and a note about how sure you are.
1

Favourite sport of 200 students. Which graph?

2

Sleep against test score. What goes on x?

3

Why can an axis starting at 90 mislead?

4

Predict the score at 7 hours of study.

5

Which pairing of data and graph is the right choice?

6

A dot plot of numbers has no axis label, no units and no title. What can a reader not work out from it?

7

Which kind of graph should always have its vertical axis start at zero, and why?

8

Which describes a good eyeballed line of best fit on a scatter plot?

Show answer

1. A bar graph. Favourite sport is a categorical variable, so the bars are the categories and their heights are the counts. A two-way table would work if you also recorded something else, such as year level. 2. Hours of sleep. It is the explanatory variable, the one you think affects the other, so it goes across the bottom, and the score goes up the side as the response. 3. Because the length of a bar is what the reader compares, and cutting the bottom off the axis makes a small difference look like a large one. Nothing on the chart is false, which is what makes it effective. 4. About 85. Read up from 7 on the horizontal axis to the line of best fit and across. It is a little outside the data, so it is a reasonable estimate rather than a certainty. 5. Monthly rainfall in Napier over a year with a time-series graph. It shows change over time; the others put the data in the wrong kind of graph. 6. What was measured, in what units, and who it was measured on. Without those it is a shape, not evidence. 7. A bar graph, because the length of each bar is the comparison. Line graphs and scatter plots may start elsewhere if the axis says so clearly. 8. A straight line through the middle of the cloud, with roughly as many points above it as below. It does not join the dots.

Worked example

The answers

  • A bar graph, because favourite sport is a category.
  • Hours of sleep, because it is the explanatory variable.
  • It makes a small difference look large, without saying anything false.
  • About 85, and it is just outside the data, so it is an estimate.
Try it

Least-Squares Regression

Full screen · PhET Interactive Simulations, University of Colorado Boulder, CC BY 4.0

Challenge

1

Seven students' quiz scores, all whole numbers, are shown on a box plot: minimum 3, lower quartile 5, median 8, upper quartile 12, maximum 15. With 7 values in order, the lower quartile is the 2nd value and the upper quartile is the 6th. (a) Show that the mean score must be from 8 to 9. (b) The mean is exactly 9. Find all seven scores. (c) How many different sets of seven scores fit the box plot?

Hint

Five of the seven values are fixed by the box plot. Only the 3rd and 5th values can move, and each is trapped between its neighbours.

Answer

(a) The total is 43 plus the 3rd and 5th values, which is between 56 and 63, so the mean is between 8 and 9. (b) 3, 5, 8, 8, 12, 12, 15. (c) 20 sets.

Step by step
  1. In order the scores are 3, 5, p, 8, q, 12, 15, where p is the 3rd value and q is the 5th.
  2. p must be from 5 to 8 and q must be from 8 to 12, to keep the values in order.
  3. The fixed values add to 43, so the total is 43 + p + q, from 43 + 5 + 8 = 56 to 43 + 8 + 12 = 63. Dividing by 7, the mean is from 8 to 9.
  4. A mean of 9 needs a total of 63, the largest possible, so p = 8 and q = 12.
  5. p has 4 choices and q has 5, so 4 × 5 = 20 sets fit the box plot.
Full working
  1. scores: 3, 5, p, 8, q, 12, 157 values in order
  2. 5 ≤ p ≤ 8 and 8 ≤ q ≤ 12stay in order
  3. 3 + 5 + 8 + 12 + 15 = 43fixed values
  4. 56 ≤ 43 + p + q ≤ 63, so 8 ≤ mean ≤ 9divide by 7
  5. mean 9: total 63, so p + q = 20, p = 8, q = 12only the largest values work
  6. 4 × 5 = 20 setschoices for p and q
  7. (a) mean from 8 to 9 (b) 3, 5, 8, 8, 12, 12, 15 (c) 20 sets
2

Six students recorded hours of study and test score: (1, 51), (2, 58), (3, 61), (4, 68), (5, 71), (6, 78). Three students drew lines by eye. Line P: score = 47 + 5 × hours. Line Q: score = 40 + 8 × hours. Line R: a flat line at score 64.5. Lines P and R both have three points above and three below. Which line is the best fit, why are the other two poor, and what does the best line predict for 4.5 hours?

Hint

For each line, work out its score at each hour and compare with the real score. Do not just count above and below: look at WHERE the points above and below are.

Answer

Line P is best: its points alternate 1 below, 1 above all the way along. Line Q is too steep: the last three points are all below it, by up to 10. Line R has 3 above and 3 below, but all the low-hour points are below and all the high-hour points above, so it misses the trend. Line P predicts 69.5 at 4.5 hours.

Step by step
  1. Line P gives 52, 57, 62, 67, 72, 77. The real scores are 1 below, 1 above, 1 below, 1 above, 1 below, 1 above. Close, and balanced all the way along.
  2. Line Q gives 48, 56, 64, 72, 80, 88. The first two points are above it but the last four are below, by up to 10 at 6 hours. It is too steep.
  3. Line R is flat at 64.5. The three low-hour points are below it and the three high-hour points are above it. The counts balance, but the line ignores the upward trend.
  4. So balancing above and below is needed, but it is not enough: the points should be mixed above and below along the whole line.
  5. Using P at 4.5 hours: 47 + 5 × 4.5 = 69.5. That is inside the data (1 to 6 hours), so it is a reasonable estimate.
Full working
  1. P: 52, 57, 62, 67, 72, 77gaps −1, +1, −1, +1, −1, +1
  2. Q: 48, 56, 64, 72, 80, 88gaps +3, +2, −3, −4, −9, −10, too steep
  3. R: 64.5 everywheregaps −13.5, −6.5, −3.5, +3.5, +6.5, +13.5, misses the trend
  4. P at 4.5: 47 + 5 × 4.5 = 69.5inside the data
  5. Line P is best; it predicts a score of 69.5 at 4.5 hours
3

120 Year 10 students were asked two things: do you keep your phone in your bedroom at night, and do you usually sleep under 8 hours? 80 keep their phone in the bedroom. 50 students in total sleep under 8 hours. 26 students do not keep a phone in the bedroom AND sleep 8 hours or more. Complete the two-way table. Sione draws a bar graph of the counts of students sleeping under 8 hours in each group and says phone-in-bedroom students are more than twice as likely to sleep under 8 hours. Is he right? Which variable is explanatory, and what should the graph show instead?

Hint

Start with the group you know most about: students with no phone in the bedroom. Then use the totals to fill the rest. To compare groups of different sizes, compare percentages, not counts.

Answer

Phone in bedroom: 36 under 8 h, 44 at 8 h or more. No phone: 14 under 8 h, 26 at 8 h or more. Sione is wrong: 36 is about 2.6 times 14, but the groups differ in size. As percentages it is 45% against 35%, about 1.3 times as likely. Phone in bedroom is the explanatory variable; the graph should show the percentage of each group sleeping under 8 hours.

Step by step
  1. No phone in the bedroom: 120 − 80 = 40 students. 26 of them sleep 8 hours or more, so 40 − 26 = 14 sleep under 8.
  2. 50 sleep under 8 hours in total, so 50 − 14 = 36 of the phone group sleep under 8, and 80 − 36 = 44 sleep 8 or more.
  3. Sione compared counts: 36 against 14. But the phone group is twice the size of the other, so of course its counts are bigger.
  4. As percentages: 36 out of 80 is 45%, and 14 out of 40 is 35%. That is about 1.3 times as likely, not more than twice.
  5. Phone in the bedroom is what we think might affect sleep, so it is the explanatory variable. A bar graph of the percentage in each group sleeping under 8 hours makes a fair comparison.
Full working
  1. no phone total = 120 − 80 = 40
  2. no phone, under 8 h = 40 − 26 = 14
  3. phone, under 8 h = 50 − 14 = 36from the total under 8
  4. phone, 8 h or more = 80 − 36 = 44
  5. 36 ÷ 80 = 45%, 14 ÷ 40 = 35%compare percentages, not counts
  6. 45 ÷ 35 ≈ 1.3, not more than 2the counts 36 and 14 mislead
  7. Sione is wrong: 45% against 35%, about 1.3 times as likely; graph percentages by phone group

More challenge problems

Science

Where science uses this

Worksheet with answersWithout answersDownload PDF
Report a mistake

More in Statistics