Chapter 6: Comparing two means

Section 6.1: Comparing two groups: quantitative response

We will compare groups of data on a quantitative variable. We still want to reveal patterns exhibited by the sample data including shape, center, and variability of the distributions of quantitative data. We will also investigate outliers.

Example 6.1: Geyser eruptions

Here is a pair of dotplots for the times between eruptions (in minutes) of the Old Faithful geyser in Yellowstone National Park. There are 107 eruptions occurring in August 1978 and95 eruptions from the same week in 2003. Do the distributions of these inter-eruption times for these two years appear to have changed?

Figure: Dot plot titled 'Old Faithful Geyser Inter-Eruption Times Grouped by Year'. The x-axis is 'inter-eruption time in minutes' with values between 40 and 110 minutes. The y-axis has two rows for the groups 'year 1978' in the bottom row and 'year 2003' in the top row.  Each row is its own dot plot.  The 'year 1978' dotplot has most of its dots between 45 and 90 minutes. The 'year 2003' dotplot has most of its dots between 80 and 105 minutes.

Figure: Dot plot titled ‘Old Faithful Geyser Inter-Eruption Times Grouped by Year’. The x-axis is ‘inter-eruption time in minutes’ with values between 40 and 110 minutes. The y-axis has two rows for the groups ‘year 1978’ in the bottom row and ‘year 2003’ in the top row. Each row is its own dot plot. The ‘year 1978’ dotplot has most of its dots between 45 and 90 minutes. The ‘year 2003’ dotplot has most of its dots between 80 and 105 minutes.

This chart has title 'Old Faithful Geyser Inter-Eruption Time by Year'.
It has x-axis 'Inter-eruption time (minutes)' with labels 40, 60, 80 and 100.
It has y-axis 'Year' with labels 1978 and 2003.
The chart is a dotplot graph that VI cannot process.

After this paragraph is a frequency table that conveys exactly the same information as the dotplot. The top row of the table has time values between 42 and 100 minutes. The middle row has count data for the year 1978 eruptions. The bottom row has count data for the year 2003 eruptions.

      time
year   42 44 45 48 49 50 51 53 54 55 56 57 58 60 61 66 67 68 69 70 71 72 73 74
  1978  1  1  1  1  1  2  7  3  1  4  2  2  1  1  3  1  2  2  1  3  2  2  6  2
  2003  0  0  0  0  0  0  0  0  0  0  1  0  1  0  0  0  0  0  0  0  1  0  0  0
      time
year   75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 98 99
  1978  7  6  2  4  3  6  3  4  5  3  1  4  0  2  1  1  1  0  1  0  1  0  0  0
  2003  0  0  1  0  1  0  0  2  1  2  4  6 11  5  4  6  4  5  4  3  4  5  5  8
      time
year   100 101 102 103 106 107 110
  1978   0   0   0   0   0   0   0
  2003   3   1   2   1   1   2   1

Order statistics

Quantitative data (think a list of numbers) can be ordered from smallest to largest. Using this ordered list, we can find the smallest or largest numbers in the list called the minimum and maximum, a number called the median that splits the list into two equal length parts (50% of the list below it and 50% above it), and numbers called lower and upper quartiles that split the the list into four equal length parts (25% below or 75% below). In fact, we can define any percentile we like, such as the 90th percentile is a number that has 90% of the list items below it.

Five number summary

The five-number summary for the distribution of a quantitative variable consists of the minimum, lower quartile, median, upper quartile, and maximum.

  1. The min in a data set is the smallest number in the data set.
  2. The lower quartile (or 25th percentile) is the number in a data set at which 25% of the data lie below it.
  3. The median (or 50th percentile) is a number in a data set at which 50% of the data lie below it when the list has odd length. When the list has even length, the median is the average of the two data points in the middle of the ordered list and is often not a number in the data set.
  4. The upper quartile (or 75th percentile) is the number in a data set at which 25% of the data lie above it.
  5. The max in a data set is the largest number in the data set.

Remarks

  • Lower and upper quartiles can be found by finding the overall median and then determining the median of the values below or above it.
  • The inter-quartile range (IQR) is the difference between the upper and lower quartiles, it is another measure of variability like standard deviation. IQR is less sensitive (more resistant) to extreme values and skewness than standard deviation.
  • A box plot is a visual display of the five-number summary.
    • It is also called a “box-and-whiskers” plot
    • The box displays the middle 50% of the distribution (between the lower and upper quartiles) and
    • Its width (which is the IQR) helps us see the variability shown as the spread of most numbers in the list
  • An outlier is more than 1.5 * IQR from the edge of the box
    • The whiskers extend to 1.5 * IQR from the edge of the box
    • Outliers are shown as dots that lie outside the range defined by the whiskers

Five number summary, dotplot, and boxplot

Please click here to open the Descriptive Statistics applet and follow the instructions below to load the Old Faithful data to compute the five number summary, and to create dotplots and boxplots that display and summarize the data.

Old Faithful Geyser data put into the Descriptive Statistics applet to find a five number summary, a dotplot of the data, and a boxplot of the data.
Old Faithful Geyser data put into the Descriptive Statistics applet to find a five number summary, a dotplot of the data, and a boxplot of the data.

Input to the Descriptive Statistics applet

  • Select data “Old Faithful”
  • Press the “Use data” button
  • Verify that quantitative variable is set to “time”
  • Select Separate by “year”
  • Under choose statistics, next to median select the checkbox “actual”
  • Under choose statistics, next to IQR select the checkbox “actual”
  • Select the checkbox for “Add Boxplot”
  • Select the checkbox for “Show outliers”

Output from the Descriptive Statistics applet

  • Sample size: n = 95 for year 2003, n = 107 for year 1978
  • Medians: 91 minutes for year 2003, 75 minutes for year 1978
  • Inter-Quartile Ranges (IQRs): 98 - 87 = 11 minutes for year 2003, 81 - 58 = 23 minutes for year 1978
  • A dotplot and boxplot for year 2003 in the top half of the figure
  • A dotplot and boxplot for year 1978 in the top half of the figure

Exploration 6.1: Cancer pamphlets

Researchers in Philadelphia investigated whether pamphlets containing information for cancer patients are written at a level that the cancer patients can comprehend (Short, Moriarty, and Cooley, 1995). First, they measured the readability of a sample of cancer pamphlets based on factors such as the length of sentences and the number of polysyllabic words, assigning each pamphlet a grade level.

The results shown in the table below are presented as a frequency table, reporting the number of pamphlets at each grade level.

Cancer Pamphlets Frequency table
Pamphlets’ readability (grade) level 6 7 8 9 10 11 12 13 14 15 16
Count (number of pamphlets) 3 3 8 4 1 1 4 2 1 2 1

Let’s work the exploration together in small groups. Please

and get started.