Skip to main content

Chapter 14 Comparing quantitative data between individuals

described in detail following the image
A diagram showing the six steps of research, arranged in a cycle: Ask, Design, Collect, Classify and summarise, Analyse, Report. Step 4 (Summarise) is highlighted, captioned β€œComparing quantitative data between individuals”.

Section 14.1 Introduction

Relational RQs compare groups. This chapter considers how to compare quantitative variables in different groups. Graphs are useful this purpose, and a table of the numerical summaries usually is produced also.

Section 14.2 Numerical summary: difference between means

When comparing quantitative variables in different groups, the data should be summarised for each group. If two groups are being compared, the difference between the means and/or medians of the two groups must also be computed. If more than two groups are being compared, the differences between one of the group means/medians (the first, or the benchmark, or the initial situation as the reference level) and the other group means/medians are also usually computed.

Example 14.1. Numerical summary table.

[107] recorded the number of chest-beats by gorillas (Table TableΒ 14.2), for gorillas under \(20\) years old (’younger’) and \(20\) years and over (’older’). A summary of the data can be tabulated as in Table TableΒ 14.3. Notice that no standard deviation or sample size is provided for the difference; these make no sense.
Table 14.2. The chest-beating rate of gorillas (in beats per \(10\) h).
Younger Older
0.7 1.3 1.5 1.7 1.8 3.0 4.4 0.0 0.2 0.4 0.8 1.1 4.0
0.9 1.5 1.5 1.7 2.6 4.1 4.4 0.1 0.3 0.6 0.9 1.6 β€”
Table 14.3. A numerical summary of the gorillas data.
Mean (beats per 10 h) Standard deviation (beats per 10 h) Sample size
Younger 2.22 1.270 14
Older 0.91 1.131 11
Difference 1.31 β€” β€”

Section 14.3 Graphs for the comparison

When a quantitative variable is measured or observed in different groups (i.e., between individuals), the distribution of each variable can be graphed separately. However, to compare the quantitative variable in the groups, appropriate graphs include:
These situations have one quantitative variable being compared in different groups (defined by one qualitative variable).

Subsection 14.3.1 Back-to-back stemplot

Back-to-back stemplots are two stemplots (Sect. SubsectionΒ 11.3.2) sharing the same stems; one group has the leaves emerging left-to-right from the stem, and the second group has the leaves emerging right-to-left from the stem. Back-to-back stemplots can only be used when two groups are being compared. Again, one advantage of using stemplots over other plots is that the original data are retained. Disadvantages are that only two groups can be compared, and not all data work well with stemplots.

Example 14.4. Back-to-back stemplots.

A back-to-back stemplot for comparing the chest-beating rate of gorillas (Fig. FigureΒ 14.5) has the leaves for younger gorillas right-to-left, and the leaves for older gorillas left-to-right, sharing the same stems. The younger gorillas have a faster chest-beating rate in general. One older gorilla has a much faster rate than the other older gorillas (a potential outlier).
Figure 14.5. Back-to-back stemplot comparing chest-beating rates of younger and older gorillas.

Subsection 14.3.2 2-D dot charts

A two-dimensional (2-D) dot chart places a dot for each observation, separated for each level of the qualitative variable (also see Sect. SubsectionΒ 12.3.1). Any number of groups can be compared.

Warning 14.6.

The axis displaying the counts (or percentages) need not start from zero, since the distance from the axis to the these numbers do not visually imply any quantity of interest. Rather, how the dots compare in the groups is the main feature of interest.

Example 14.7. 2-D dot charts.

For the chest-beating data seen in Example ExampleΒ 14.4, a dot chart is shown in Fig. FigureΒ 14.8. Many observations are the same, so some points would be overplotted if points were not stacked (left panel), or jittered (right panel).
Figure 14.8. 2-D dot chart for the chest-beating data: stacked (left) and jittered (right).

Subsection 14.3.3 Boxplots

A boxplot is a picture of the quantiles (Sect. SubsectionΒ 11.7.3) for each group, drawn side-by-side on the same plot (and so are sometimes called parallel boxplots or side-by-side boxplots). Any number of groups can be compared using a boxplot. Sometimes, the mean of each groups is added to the boxplot using, for example, a solid dot.
The distribution for each group is summarised by five numbers: the minimum value; the first quartile (\(Q_1\)); the median (\(Q_2\)); the third quartile (\(Q_3\)); and the maximum value. Outliers, identified using the IQR rule (Sect. SubsectionΒ 11.8.2), are usually shown too. The values of \(Q_1\text{,}\) the median, and \(Q_3\) for each group can be used to compare the distributions. Different software may use different rules for computing quartiles, and hence may produce slightly different boxplots.

Warning 14.9.

The axis displaying these five numbers need not start from zero, since the distance from the axis to the these numbers do not visually imply any quantity of interest. Rather, the boxes display the values of these five numbers for each group relative to each other, which is of interest.

Warning 14.10.

Boxplots summarise data with only five numbers (sometimes called the five-number summary), so details of the distributions are lost. For this reason, boxplots are excellent for comparing distributions, but histograms are better for displaying the distribution of a single quantitative variable.

Example 14.11. Boxplots.

The boxplot for the chest-beating data (Example ExampleΒ 14.4) is shown in Fig. FigureΒ 14.12. No outliers are identified for younger gorillas; one large outlier is identified for the older gorillas. The boxplot shows a distinct difference between the chest-beating rates of older and younger gorillas.
Figure 14.12. The boxplot for the chest-beating data.
The detail of the boxplots are explained in Fig. FigureΒ 14.13. Firstly, focus on just the boxplot for the younger gorillas (i.e., the left box). Boxplots have five horizontal lines.
  1. Top line: the fastest chest-beating rate (largest value) is \(4.4\) per \(10\) h.
  2. Second line from top: \(75\)% of observations are smaller than about \(2.9\) per \(10\) h, represented by the line at the top of the central box. This is the third quartile (\(Q_3\)).
  3. Middle line: \(50\)% of observations are smaller than about \(1.7\) per \(10\) h, represented by the line inside the central box. This is the median value, the second quartile (\(Q_2\)).
  4. Second line from bottom: \(25\)% of observations are smaller than about \(1.5\) per \(10\) h, represented by the line at the bottom of the central box. This is the first quartile (\(Q_1\)).
  5. Bottom line: the slowest chest-beating rate (smallest value) is \(0.7\) per \(10\) h.
Figure 14.13. Explaining the boxplots for the chest-beating data.
The box for the older gorillas (Fig. FigureΒ 14.12, right box) is slightly different: one observation is identified with a point, above the top line. Computer software identifies this observation as an extreme outlier using the IQR rule (Sect. SubsectionΒ 11.8.2), and has plotted this point separately.
The values of \(Q_1\text{,}\) the median and \(Q_3\) are all substantially larger for the younger gorillas, suggesting that younger gorillas have, in general, faster chest-beating rates.

Example 14.14. Boxplots.

Boxplots can be plotted horizontally too, which leaves space for long labels of the qualitative variable. In Fig. FigureΒ 14.15 (based on [125]), the three dental cements are very different regarding their push-out forces.
Figure 14.15. Comparing three push-out values for three dental cements.

Section 14.4 Example: water access

[119] recorded data about access to water in three rural communities in Cameroon (Sect. SectionΒ 11.10). The study could be used to determine associations to the incidence of diarrhoea in young children (\(85\) households had children under \(5\) years of age).
The graphs (Fig. FigureΒ 14.16) and summary (Table TableΒ 14.17) show that households in which diarrhoea was found in the last two weeks in children had older household coordinators, more people in the household, and more children under \(5\) years of age in the household. These may be expected: older female coordinators probably have more children, hence more children in the household under \(5\text{,}\) and so more children (and so people) are in the household in general.
Figure 14.16. Three plots for the water access data in 85 households (59 household reported no diarrhoea in children under 5 years of age; 26 reported diarrhoea in children under 5 years of age).
Table 14.17. A summary of the quantitative variables in the water-access study, according to whether diarrhoea had been observed in the last two weeks in children under \(5\) years of age.
\(n\) Mean Median Std dev. IQR
Woman coordinator’s age (in years)
All households with children 85 40.2 37.0 13.90 28.50
Incidents of diarrhoea 26 45.0 46.5 14.04 31.00
No incidents of diarrhoea 59 38.1 35.0 13.44 24.00
Difference β€” 6.9 β€” β€” β€”
Household size
All households with children 85 8.4 7.0 4.93 6.00
Incidents of diarrhoea 26 10.5 8.5 6.51 8.00
No incidents of diarrhoea 59 7.5 6.0 3.78 5.00
Difference β€” 3.0 β€” β€” β€”
Children under 5 in household
All households with children 85 2.2 2.0 1.56 2.00
Incidents of diarrhoea 26 2.8 2.0 2.01 2.00
No incidents of diarrhoea 59 1.9 2.0 1.26 1.00
Difference β€” 0.9 β€” β€” β€”

Section 14.5 Chapter summary

Quantitative data can be compared between different groups (between individuals comparisons) using a back-to-back stemplot, boxplot or \(2\)-D dot chart. A summary table should show the numerical summaries for the levels of the quantitative variable, and the between-group differences.

Reading Questions 14.6 Quick review questions

Are the following statements true or false?

2.

A back-to-back stemplot is an appropriate graph for comparing a quantitative variable in two or more groups.
Answer.
False; only compares two groups.

3.

A case-profile plot is an appropriate graph for comparing a quantitative variable in two or more groups.
Answer.
False; a case-profile plot is appropriate for within-individual changes.

4.

When comparing a quantitative variable in two groups, the difference between the two sample sizes should be included.
Answer.
False; difference between sample sizes is meaningless.

Exercises 14.7 Exercises

Answers to odd-numbered exercises are given at the end of the book.

2.

[Dataset: AISsub] [126] studied athletes at the Australian Institute of Sport (AIS). Numerous physical and blood measurements were taken from high performance athletes. Figure FigureΒ 14.18 (right panel) compares the heights of females in two similar sports: basketball and netball. (Netball was derived from basketball.)
  1. What does the plot reveal about the heights of the females in each sport?
  2. What is the median for each sport (approximately)?
  3. What is the IQR for each sport (approximately)?
Figure 14.18. Left: cost increases for two different building project delivery methods: Design/Build and Design/Bid/Build (the grey, horizontal line is where the projected costs are the same as the actual cost). Right: the heights of female basketball and netball players attending the AIS.
Figure 14.19. Match the histogram with the boxplot.

4.

[128] [113] compared the dimensions of jellyfish at two sites at Hawkesbury River, NSW (Dangar Island; Salamander Bay) to determine the difference between the jellyfish at each site. A histogram of the breadth of jellyfish at Dangar Island Bay is shown in Fig. FigureΒ 14.20 (left panel).
  1. Two students are arguing about the median breadth. Student 1 says: The bars in the histogram have heights of \(10\text{,}\) \(2\text{,}\) \(4\text{,}\) \(2\) and \(4\text{.}\) When these numbers are put in order, they are: \(2\text{,}\) \(2\text{,}\) \(4\text{,}\) \(4\text{,}\) and \(10\text{.}\) The median breadth is the median of these numbers, so the median breadth is the middle one: \(4\) is the median. Student 2 responds: You have the correct answer, but for the wrong reason! There are five bars, and the middle bar is the third bar. Since the third bar has a height of \(4\text{,}\) the median breadth is \(4\text{.}\) Which student, if either, is correct?
  2. Describe the histogram.
  3. A boxplot comparing the breadths of jellyfish at Dangar Island and Salamander Bay is shown in Fig. FigureΒ 14.20 (right panel). Describe and compare the breadths of the jellyfish.
  4. What is the median breadth for the jellyfish at each location?
  5. Which box in the boxplot represents the Dangar Island jellyfish (in Fig. FigureΒ 14.20, left panel)?
Figure 14.20. Left: a histogram of the breadth of jellyfish at Dangar Island. Right: a boxplot of the breadth of jellyfish at two sites.

5.

[122] studied the productivity of construction workers, recording (among other variables) the rate at which concrete panels could be installed by workers. Data for three different female workers in the study are shown in Table TableΒ 14.21, gathered over four installation periods of \(50\) min each.
  1. Compute the IQR for each worker.
  2. Construct the boxplot for comparing the three workers.
  3. Draw the approximate histograms for each worker.
  4. What do you learn about the workers?
Table 14.21. The productivity of three workers installing concrete panels (in panels per minute).
Worker 1 Worker 2 Worker 3
Mean 1.24 1.73 1.36
Minimum 0.59 1.13 0.86
1st quartile 0.88 1.51 1.16
Median 1.35 1.70 1.38
3rd quartile 1.49 1.91 1.58
Maximum 1.88 3.00 2.17

6.

In a study of the temperature in offices, [124] compared the temperature in three offices (during working hours) at Charles Sturt University (Australia; CSU); the data are summarised in Table TableΒ 14.22.
  1. Compute the IQR for the temperatures in each office.
  2. Construct the boxplot for comparing the temperatures in the three offices.
  3. Draw the approximate histograms for each office.
  4. What do you learn about the offices?
Table 14.22. A summary of the temperature (in degrees C) in three offices at CSU during working hours. Office A is on the ground floor; Offices B and C are on the top floor.
Office A Office B Office C
Mean 24.1 25.3 25.7
Minimum 16.4 15.9 20.1
\(Q_1\) 22.8 23.8 24.6
Median 24.4 25.5 26.1
\(Q_3\) 25.5 26.9 27.2
Maximum 27.4 31.0 30.3

7.

[Dataset: NHANES] Consider this RQ:
Among Americans, is the mean direct HDL cholesterol different for current smokers and non-smokers?
Data to answer this RQ are available from the American National Health and Nutrition Examination Survey (nhanes) [130].
  1. What would be an appropriate graph to display the comparison?
  2. Use the software output (Fig. FigureΒ 14.23) to construct an appropriate table showing the numerical summary relevant to the RQ.
Figure 14.23. Software output for the nhanes data.

8.

[Dataset: ForwardFall] [127] compared the lean-forward angle in younger and older women. An elaborate set-up was constructed to measure this angle, using a harness. Consider the RQ:
Among healthy women, what is difference between the mean lean-forward angle for younger women compared to older women?
The data are shown in Table TableΒ 14.24.
  1. What is an appropriate graph to display the comparison?
  2. Construct an appropriate numerical summary from the software output (Fig. FigureΒ 14.25).
Table 14.24. Lean-forward angles (in degrees) for older women (\(n = 5\)) and younger women (\(n = 10\)).
Younger women Older women
29 34 33 27 28 18 15 23 13 12
32 31 34 32 27 β€” β€” β€” β€” β€”
Figure 14.25. Software output for the lean-forward angles data.

9.

[Dataset: Speed] [120] studied adding additional signage to reduce vehicle speeds on freeway exit ramps. At one site (Ningxuan Freeway), speeds were recorded for \(38\) vehicles before the extra signage was added, and then for \(41\) different vehicles after the extra signage was added.
The researchers are hoping that the addition of extra signage will reduce the mean speed of the vehicles. The RQ is:
At this freeway exit, how much is the mean vehicle speed reduced after extra signage is added?
  1. Using the software output in Fig. FigureΒ 14.26, summarise the data numerically, then construct a suitable summary table.
  2. Produce a boxplot of the data (use a computer if necessary).
Figure 14.26. Software output for the speed data.

10.

[Dataset: Deceleration] [120] studied adding additional signage to reduce vehicle speeds on freeway exit ramps. At one site (Ningxuan Freeway), speeds were recorded at various points on the freeway exit for \(38\) vehicles before the extra signage was added, and then for \(41\) vehicles after the extra signage was added.
From this data, the deceleration of each vehicle was determined as the vehicle left the \(120\) km.h\(^{-1}\) speed zone and approached the \(80\) km.h\(^{-1}\) speed zone. The RQ is:
At this freeway exit, what is the difference between the mean vehicle deceleration, comparing the times before the extra signage is added and after extra signage is added?
In this context, the researchers are hoping that the extra signage might cause cars to slow down faster (i.e., they will decelerate more, on average, after adding the extra signage).
  1. Using the software output in Fig. FigureΒ 14.27, summarise the data numerically, then construct a suitable summary table.
  2. Produce a boxplot of the data (use a computer if necessary).
  3. What does a negative deceleration value represent?
Figure 14.27. Software output for the deceleration data.

11.

[Dataset: Typing] The Typing dataset contains information about the typing speed and accuracy for students, from an online typing test [69]. The four variables are: typing speed (mTS), typing accuracy (mAcc), age (Age), and sex (Sex) for \(1 301\) students.
  1. Produce appropriate numerical summaries for the quantitative variables.
  2. Produce appropriate numerical summaries for comparing the quantitative variables for different values of the qualitative variable.
  3. What do you learn from these numerical summaries?

12.

[Dataset: Dental] [129] recorded the sugar consumption and the average number of decayed, missing or filled teeth (DMFT) in \(29\) industrialised countries and \(61\) non-industrialised countries.
  1. Produce appropriate numerical summaries for the two quantitative variables.
  2. Produce appropriate numerical summaries for comparing the two quantitative variables for industrialised countries and non-industrialised countries.
  3. What do you learn from these numerical summaries?

13.

[Dataset: Snakes] Some Mexican garter snakes (Thamnophis melanogaster) live in habitats with no crayfish, while some live in habitats with crayfish and use crayfish as a food source. [121] were interested in whether the snakes in these regions were different:
For female Mexican garter snakes, is the mean snout–vent length (SVL) different for those in regions with crayfish and without crayfish?
Two different groups of snakes are studied (so the study uses a between-individuals comparison). Boxplots of the data are shown in Fig. FigureΒ 14.28.
  1. Describe the boxplot displaying the SVL for the two regions, for all crayfish (left panel). Compare the means for the two regions.
  2. Describe the boxplot displaying the SVL for the two regions, for female crayfish (centre panel). Compare the means for the two regions.
  3. Describe the boxplot displaying the SVL for the two regions, for male crayfish (right panel). Compare the means for the two regions.
  4. How would you describe the variable ’Sex of the snake’: extraneous, confounding, lurking, response or explanatory?
Figure 14.28. The snout–vent length (SVL) for Mexican garter snakes, living in crayfish or non-crayfish regions. The solid dots represent the means.