17 More about tables and graphs

So far, you have learnt to ask a RQ, design a study, collect the data, describe the data, and summarise data. In this chapter, you will learn to:

  • construct clear and informative graphs.
  • construct clear and informative tables.

17.1 Introduction

A summary of the data is important for understanding the data, and for planning the direction of the analysis. In this chapter, we make some general comments for constructing graohs and tables. Always remember:

The purpose of a graph and a table is to display the information in the clearest, simplest possible way, to facilitate understanding the message(s) in the data.

17.2 Preparing graphs

Helping readers to understand the data is the goal of producing a graph. You should be able to sketch graphs by hand, but usually software is used to produce graphs. Using a computer makes it easy to try different graphs, to change features of graphs, and to produce the best graph possible. When creating graphs, ensure you:

  • do make graphs clear and well-labelled
  • do add titles and axis labels.
  • do add units of measurement where necessary.
  • do add informative captions below the figure.
  • do add units of measurement and axis labels where appropriate.
  • do make sure text and details are easy to read.
  • do ensure the axis scales are appropriate.
  • do add any necessary explanations.
  • do make it easy for readers to easily make the important comparisons, as far as possible.
  • do not add artificial third dimensions, or other 'chart junk' (Su 2008).
  • do not add optical illusions, such as an artificial third dimension.
  • do not use distracting colours and fonts; only use different colours and fonts if necessary, and explain that purpose if it is not clear.
  • do not make errors.

Some specific problems to be aware of are discussed in the subsections that follows.

17.2.1 Avoid unnecessary third dimensions

Graphs should focus on clear communication. One barrier to clear communication is using an unnecessary third dimension. This is poor: such graphs can be misleading and hard to read (Siegrist 1996).

Example 17.1 (Two- and three-dimensional plots) In the NHANES study (Control and (CDC) 2024), the age and sex of each participant were recorded. Using Fig. 17.1 (left panel), can you easily determine if more females or more males are present in each age group?

The artificial third dimension makes determining the heights of the bars hard. In contrast, a \(2\)-D graph (a side-by-side bar graph; Fig. 17.1, right panel) makes it clear whether each age group has more females or more males.

Two plots of the NHANES participants, divided by age group and sex. Left: a three-dimensional bar chart. Right: a side-by-side bar chart.

FIGURE 17.1: Two plots of the NHANES participants, divided by age group and sex. Left: a three-dimensional bar chart. Right: a side-by-side bar chart.

17.2.2 Avoid overplotting

Some plots, such as dot charts and scatterplots, may suffer from overplotting: when multiple observations have the same (or nearly the same) values, and these cannot be distinguished on the graph. Overplotting can especially be a problem when plotting discrete quantitative data. In one-dimensional cases (such as dot plots), points can be stacked; see Sect. 11.3.3. More generally, points may be jittered by adding a small amount of randomness to the observations; see Example 15.3. Overplotted points can change readers' impression of the data, since some observations are obscured and are effectively 'lost' to the reader.

17.2.3 Take care when truncating axes

One common optical illusion occurs when the frequency (or percentage) axis does not start at zero. This is a problem in graphs where the distance represented visually implies the frequency of those observations, as may be the case for bar charts, dot charts, or histograms. This is not a problem in, for example, scatterplots, where the distance of points from zero do not visually imply any quantity of interest.

Example 17.2 (Truncating is not appropriate) Consider data recording the number of lung cancer cases in Fredericia in various age groups (Andersen 1977).

The animation below shows a bar chart with the count (vertical axis) starting at zero (when the counts in each age group look similar), and then gradually changing where the vertical axis starts... so that the final bar chart make the number of cases in each age groups look very different. The graph is visually misleading when the graph does not start at a count of zero, since the height of the bars from the axis visually implies the frequency of those observations.

Example 17.3 (Truncating is appropriate) Consider data recording the body temperature of \(n = 130\) people (Mackowiak, Wasserman, and Levine (1992), Shoemaker (1996)). A histogram of the data (Fig. 17.2, left panel) clearly shows the distribution of body temperatures. The horizontal axis starts at \(35.5\)oC. However, this does not create any problems as the distances from a temperature of \(0\)oC do not visual imply any quantity of interest.

In contrast, starting the horizontal axis at a temperature of \(0\)oC (Fig. 17.2, right panel) makes any details in the histogram difficult to see; the histogram is pointless.

Two histograms displaying the body temperature of $130$ people. Left: a well-constructed histogram. Right: A poorly-constructed histogram.

FIGURE 17.2: Two histograms displaying the body temperature of \(130\) people. Left: a well-constructed histogram. Right: A poorly-constructed histogram.

17.2.4 Take care when using pie charts

As noted in Sect. 12.3.3, using pie charts may present challenges since they are hard to read: humans compare lengths (bar and dot charts) better than angles (pie charts) (Friel, Curcio, and Bright 2001). Pie charts are also difficult to use with levels having zero or small counts.

Example 17.4 (Pie charts with small counts) Solomon et al. (2002) studied the use of ginko for memory enhancement. Caregivers blinded to the treatment (ginko or placebo) reported the impact on subjects' memory. The bar chart (Fig. 17.3, left panel), for subjects on the placebo, shows that four of the available categories had zero responses, and one had a very small number of responses (two). The pie chart (right) make the small category difficult to see, and the categories with zero counts impossible to see.

Data with zeros and small counts are easy to see in a bar chart (left panel) and dot chart, but difficult to see in a pie chart (right panel).

FIGURE 17.3: Data with zeros and small counts are easy to see in a bar chart (left panel) and dot chart, but difficult to see in a pie chart (right panel).

17.3 Preparing tables

A computer is helpful for constructing tables. Using a computer also makes it easy to try different orientations or layouts.

As with graphs, the purpose of tables is to help readers understand the data. When creating numerical summary tables, ensure you:

  • do make tables clear and well-labelled.
  • do use clear row and column labels (as necessary).
  • do add units of measurement where necessary.
  • do add informative captions above the table.
  • do add units of measurement and value labels where appropriate.
  • do make sure text and details are easy to read.
  • do round numbers appropriately (don't necessarily use all significant figures provided by software).
  • do align numbers in the table by decimal point if possible, for easier reading and comparing.
  • do construct the table to allow readers to easily make the important comparisons, as far as possible (space restriction may take precedence, for example).
  • do not use distracting colours and fonts; only use different colours and fonts if necessary, and explain that purpose if it is not clear.
  • do not use vertical lines (in general), and use very few horizontal lines. Horizontal lines can be used to group columns (for example, see Table 17.1).

17.4 Example: water access

López-Serrano et al. (2022) recorded data about access to water in three rural communities in Cameroon (see Sects. 12.7 and 11.10). The study could be used to determine contributors to the incidence of diarrhoea in young children (\(85\) households had children under \(5\) years of age). Relationships between the incidence of diarrhoea and some other variables appear in Figs. 13.3 and 15.6. A summary table of information can also be constructed (Table 17.1).

In this table, note that:

  • quantitative and qualitative variables are summarised differently, but appropriately.
  • units of measurements are given where appropriate (i.e., only for age).
  • numbers in columns are aligned for easier reading and comparing.
TABLE 17.1: Numerical summary of the water-access data in \(85\) households with children, according of whether children under \(5\) years of age had reported diarrhoea in the last two weeks.
All households
Reported diarrhoea
No reported diarrhoea
\(n\) Summary \(n\) Summary \(n\) Summary
Age\(^a\) \(85\) \(37.0\)  \(( 28.0 )\) \(59\) \(35.0\)  \(( 22.5 )\) \(26\) \(46.5\)  \(( 28.5 )\)
Household size\(^b\) \(85\) \(\phantom{0}7.0\)  \(( \phantom{0}6.0 )\) \(59\) \(\phantom{0}6.0\)  \(( \phantom{0}4.5 )\) \(26\) \(\phantom{0}8.5\)  \(( \phantom{0}7.8 )\)
Under 5s in household\(^c\) \(85\) \(\phantom{0}2.0\)  \(( \phantom{0}2.0 )\) \(59\) \(\phantom{0}2.0\)  \(( \phantom{0}1.0 )\) \(26\) \(\phantom{0}2.0\)  \(( \phantom{0}1.8 )\)
Region\(^b\)
Mbeng \(26\) \(30.6\)% \(14\) \(53.8\)% \(12\) \(46.2\)%
Mbih \(28\) \(32.9\)% \(19\) \(67.9\)% \(\phantom{0}9\) \(32.1\)%
Ntsingbeu \(31\) \(36.5\)% \(26\) \(83.9\)% \(\phantom{0}5\) \(16.1\)%
Water source\(^b\)
Tap \(\phantom{0}6\) \(\phantom{0}7.1\)% \(\phantom{0}5\) \(83.3\)% \(\phantom{0}1\) \(16.7\)%
Bore \(56\) \(65.9\)% \(40\) \(71.4\)% \(16\) \(28.6\)%
Well \(10\) \(11.8\)% \(\phantom{0}5\) \(50.0\)% \(\phantom{0}5\) \(50.0\)%
River \(13\) \(15.3\)% \(\phantom{0}9\) \(69.2\)% \(\phantom{0}4\) \(30.8\)%
Education\(^b\)
Primary or less \(38\) \(44.7\)% \(27\) \(71.1\)% \(11\) \(28.9\)%
Secondary or higher \(47\) \(55.3\)% \(32\) \(68.1\)% \(15\) \(31.9\)%
Has livestock\(^b\)
No \(20\) \(23.5\)% \(17\) \(85.0\)% \(\phantom{0}3\) \(15.0\)%
Yes \(65\) \(76.5\)% \(42\) \(64.6\)% \(23\) \(35.4\)%
a Quantitative variables are summarised using medians and IQR
b Qualitative variables are summarised using counts and percentages

The table summarises the sample, but RQs are about the population. For example, one RQ could be:

Is the percentage of households with children under \(5\) years of age having diarrhoea the same for households that do and do not keep livestock?

Since the observed sample is one of countless possible samples that may have been selected, answering RQs about the population is not straightforward. In the observed sample, \(85.0\)% of households that did not keep livestock reported diarrhoea in children under \(5\), while \(64.6\)% of households that did keep livestock reported diarrhoea in children under \(5\). That is, a difference is seen in the sample; but RQs ask about the population.

Broadly, two possible reasons could explain why the sample percentages of households reporting diarrhoea in children are different:

  • the population percentages are the same. The sample percentages are different simply because of the households selected in this particular sample. Another sample, with different households, might produce different sample percentages. Sampling variation explains the difference in the sample percentages.

  • the population percentages are different. The difference between the sample percentages reflects this difference between the population percentages.

The difficulty is knowing which of these reasons ('hypotheses') is the most likely explanation for the difference between the sample percentages. This question is of prime importance as it answers the RQ. Tools for answering these questions are considered later in this book.

17.5 Quick revision questions

Are the following statements true or false?

  1. Graphs usually have their captions under the figure.
  2. Graphs should use as many colours as possible.
  3. Graphs should usually be carefully created using computer software.
  4. Tables should have plenty of horizontal and vertical lines.
  5. Tables usually have their captions under the table.

17.6 Exercises

Answers to odd-numbered exercises are available in App. E.

Exercise 17.1 What would be the best graph for displaying the data for these situations?

  1. Researchers record the pH of water and the temperature of the water, in various creeks, to explore the relationship.
  2. Researchers measure the difference between each swimmers' fastest \(100\)time and their fastest \(200\)time. The researchers were interested in the average time difference.
  3. A research study examined the way in which students usually came to university (bus; private car; car pooling; etc.) and their program of study.

Exercise 17.2 What would be the best graph for displaying the data for these situations?

  1. Researchers record the number of times a specific recycling bin is used each day at a shopping centre, over many days.
  2. Researchers measure the difference between heart rate before and two hours after drinking a cup of coffee. The researchers were interested in the average increase in heart rate.
  3. A research study recorded the diet of students (vegan; vegetarian; other) and the cost of groceries in the previous week, for many students. The researchers were exploring if there was any relationship between diet and cost of groceries.

Exercise 17.3 Schepaschenko et al. (2017a) recorded these variables for \(385\) lime trees in Russia:

  • the foliage biomass, in kg (the response variable);
  • the tree diameter, in cm (the explanatory variable);
  • the age of the tree, in years; and
  • the origin of the tree, one of Coppice, Natural, or Planted.

The purpose of the study is to estimate the foliage biomass from the tree diameter, and perhaps the other extraneous variables. What graphs would be useful?

Exercise 17.4 Lane (2002) recorded the soil nitrogen after applying different fertilizer doses. The researchers recorded:

  • the fertilizer dose, in kilograms of nitrogen per hectare;
  • the soil nitrogen, in kilograms of nitrogen per hectare; and
  • the fertilizer source; one of 'inorganic' or 'organic'.

What graphs would be useful for understanding the data?

Exercise 17.5 Maron (2007) counted the number of noisy miners (a small Australian bird) and the number of eucalyptus trees in random quadrats. Critique the graph of the data (Fig. 17.4, left panel).

Left: the number of noisy miners and the number of eucalyptus trees. Right: a scatterplot of the colour of female horseshoe crabs and the condition of their spines.

FIGURE 17.4: Left: the number of noisy miners and the number of eucalyptus trees. Right: a scatterplot of the colour of female horseshoe crabs and the condition of their spines.

Exercise 17.6 Brockmann (1996) recorded, among other things, the colour of the carapace ('Light medium', 'Medium', 'Dark medium' or 'Dark') and the condition of the carapace ('Both OK', 'One OK', 'None OK') of \(n = 173\) female horseshoe crabs. Critique the scatterplot (Fig. 17.4, right panel) used to explore the data.

Exercise 17.7 Danielsson et al. (2014) examined the change in MADRS (a quantitative scale measuring level of depression) and treatment group (whether each person was treated using: exercise; body awareness; or advice).

  1. What is the response variable?
  2. What is the explanatory variable?
  3. What graphs would be useful for exploring the data and the relationships of interest?

Exercise 17.8 A study of high-performance athletes at the Australian Institute of Sport (AIS) (Telford and Cunningham 1991) recorded numerous variables about athletes. A plot for the sports played by the athletes is shown in Fig. 17.5.

How would you describe the data: left skewed, right skewed, approximately symmetrical? Or something else?

Sports played by athletes in the AIS study.

FIGURE 17.5: Sports played by athletes in the AIS study.

Exercise 17.9 [Dataset: Typing] The Typing dataset (Pinet et al. 2022) contains four variables: typing speed (mTS), typing accuracy (mAcc), age (Age). and sex (Sex) for \(1301\) students. Produce graphs necessary for understanding the data, making sure to explain what they reveal.

Does the mean typing speed or mean accuracy appear to differ by the age or sex of the student? What other questions would be useful to ask about the data?

Exercise 17.10 [Dataset: NHANES] Consider the NHANES data again. In preparing a paper about this study, suppose Fig. 17.6 and Tables 17.2 were produced. Critique these.

TABLE 17.2: A table of results.
Mean Std dev
Current smoker \(206.6\) \(46\)
Current non-smoker \(214.64\) \(48.7945\)
Difference \(8.03\)
A boxplot.

FIGURE 17.6: A boxplot.