From Raw Values to a Group Comparison
A useful comparison of two groups is more than a list of averages. The display should make the groups comparable, the summaries should match the shape and spread of the data, and unusual observations should be checked rather than automatically deleted. A clear conclusion then describes what these data show in context, without claiming more than the data can support.
The examples below use hypothetical waiting times, in minutes, for two groups of eight patients at two fictional clinics. The data are deliberately small enough to inspect directly. The groups are called A and B; no claim is being made about real clinics or patients.
Choose a Display That Keeps the Groups Aligned
For a small quantitative data set, a dotplot is useful because it shows each observation and how values are distributed. To compare groups, draw the dotplots on the same horizontal scale, with one group above the other. Shared units and a shared scale make location, spread, overlap, and unusual values easier to compare. For these data, a common scale in minutes would include the values from 8 through 25; it is important not to compress the gap from 13 to 25 so that it looks like a small difference.
The table gives the observations in order and a frequency summary to support an aligned dotplot. Each dot represents one recorded waiting time. The interval from 14 to 24 has no observations in either group; the value 25 is separated from the cluster of smaller values.
| Waiting time (minutes) | Group A count | Group B count |
|---|---|---|
| 8 | 1 | 0 |
| 9 | 2 | 1 |
| 10 | 2 | 2 |
| 11 | 1 | 1 |
| 12 | 1 | 2 |
| 13 | 1 | 1 |
| 14 through 24 | 0 | 0 |
| 25 | 0 | 1 |
Worked Example: Summarizing Both Groups
Worked Example: Summarizing Both Groups
Use the hypothetical waiting times in the table to compare the centers and spreads of Groups A and B. For quartiles, use the median-of-halves convention: sort the observations, find the median, then find \(Q_1\) as the median of the lower half and \(Q_3\) as the median of the upper half.
Group A. The ordered times are 8, 9, 9, 10, 10, 11, 12, and 13 minutes. The mean is
With eight observations, the median is the average of the fourth and fifth values: \((10+10)/2=10\) minutes. The lower half is 8, 9, 9, 10, so \(Q_{1,A}=(9+9)/2=9\) minutes. The upper half is 10, 11, 12, 13, so \(Q_{3,A}=(11+12)/2=11.5\) minutes. Therefore, \(IQR_A=Q_{3,A}-Q_{1,A}=11.5-9=2.5\) minutes.
For comparison, the sample standard deviation summarizes spread around the sample mean. Its formula divides the sum of squared deviations by \(n-1\), then takes the square root. For Group A,
Group B. The ordered times are 9, 10, 10, 11, 12, 12, 13, and 25 minutes. The mean is
The median is \((11+12)/2=11.5\) minutes. The lower half is 9, 10, 10, 11, giving \(Q_{1,B}=(10+10)/2=10\) minutes. The upper half is 12, 12, 13, 25, giving \(Q_{3,B}=(12+13)/2=12.5\) minutes. Thus, \(IQR_B=12.5-10=2.5\) minutes.
The sum of squared deviations from the Group B mean is 183.5, so
The means differ by \(12.75-10.25=2.50\) minutes, and the medians differ by \(11.5-10=1.5\) minutes. The IQRs are both 2.5 minutes, while Group B has the larger sample standard deviation. The display helps explain why: seven Group B times lie between 9 and 13 minutes, but one is 25 minutes. That isolated high value pulls the mean upward and adds substantially to the squared deviations used in the standard deviation. Reporting just one center or one measure of spread would hide some of this pattern.
Check a Flagged Observation Before Deciding What to Report
The 1.5-IQR rule provides a way to flag observations that are far from the middle half of a group. For a group with first and third quartiles \(Q_1\) and \(Q_3\), the lower and upper fences are \(Q_1-1.5(IQR)\) and \(Q_3+1.5(IQR)\). A value below the lower fence or above the upper fence is flagged by this rule. A flag is a prompt for investigation, not proof that the value is erroneous or that it must be removed.
Worked Example: Applying the Fences and Checking the Record
Apply the 1.5-IQR rule to the waiting times, then decide how to handle the 25-minute observation.
For Group A, \(Q_1=9\), \(Q_3=11.5\), and \(IQR=2.5\) minutes. Its fences are
All Group A observations fall between 5.25 and 15.25 minutes, so none is flagged. For Group B, \(Q_1=10\), \(Q_3=12.5\), and \(IQR=2.5\) minutes. Its fences are
The 25-minute time is above the upper fence of 16.25 minutes, so it is flagged. The appropriate next step is to check the record and the measurement process. In this hypothetical example, suppose the original record confirms that the wait was 25 minutes and that the recording was not a data-entry error. The observation should remain in the data: being unusual does not make it invalid.
The effect on the mean can be quantified without treating removal as justified. The seven smaller Group B times sum to 77 minutes and have mean \(77/7=11\) minutes. Adding the verified 25-minute observation gives a new mean of \((77+25)/8=12.75\) minutes, a rise of \(12.75-11=1.75\) minutes. This illustrates the sensitivity of the mean to a distant value; it does not establish that the value should be excluded.
Why the Two Measures of Center Tell Different Stories
The mean uses every value and is sensitive to distance from the rest of the data. The median depends on the middle position or positions in the ordered list, so an extreme value has less influence on it. This difference is why comparing both centers is useful when a dotplot shows an isolated observation.
Here, the difference between the group means is 2.50 minutes, while the difference between the medians is 1.5 minutes. Neither calculation is wrong: they summarize different features of these data. The means describe average recorded waiting time and reflect the 25-minute observation. The medians describe the middle of each group’s ordered observations and are less affected by that value. The equal IQRs indicate that the middle halves have the same width under the stated quartile convention, while the standard deviations reflect the greater overall spread in Group B.
A useful check on the standard deviation calculation is to confirm that it is expressed in the original units—in this case, minutes. The deviations are squared during calculation, but taking the square root returns the result to minutes. The standard deviation describes spread around the mean; it is not the range, nor does it mean that every observation lies within one standard deviation of the mean.
Thus, a value far above the existing mean raises the new mean, and the larger its distance from that mean, the larger the shift. For Group B, \(m=7\), \(\bar{x}=11\), and \(x=25\), so the increase is \((25-11)/8=1.75\) minutes, matching the direct calculation.
Worked Example: Writing a Cautious Comparison
Worked Example: Writing a Cautious Comparison
Write a short comparison using the display and summaries, while keeping the conclusion limited to the hypothetical observations.
A suitable report is: “Among these eight recorded waiting times per group, Group B had a higher mean than Group A (12.75 versus 10.25 minutes) and a higher median (11.5 versus 10 minutes). The middle-half widths were equal at 2.5 minutes. Group B had a larger sample standard deviation (5.121 versus 1.669 minutes), largely reflecting one verified 25-minute wait that was flagged by the 1.5-IQR rule. The groups overlap across much of the 9-to-13-minute range, so the summaries do not mean that every Group B wait was longer than every Group A wait.”
This report names the groups, gives units, distinguishes the two measures of center, and explains the unusual value without silently excluding it. It also avoids claiming that clinic assignment caused a difference or that these eight observations establish a general pattern. Such claims would require information about how the data were collected and what population, if any, they represent. Here the supported conclusion is descriptive: it concerns the recorded times shown.
Common Mistakes
- Comparing displays with different scales. A taller-looking group may simply have a different axis. Use the same units and horizontal scale for both groups.
- Reporting only the mean when a value is isolated. A mean can be pulled toward an extreme observation. Inspect the display and consider reporting the median and IQR as well.
- Treating a flagged value as a mistake. A fence identifies an unusual value relative to the group’s quartiles; it does not diagnose a recording error. Check the source before changing or excluding data.
- Removing a value only because it changes the result. A verified observation remains part of the recorded group. If a different summary is also useful, explain why and report the decision transparently.
- Writing a causal or universal conclusion from a small descriptive comparison. State what the observed groups show, and do not claim that the group label caused the difference or that all future observations will follow it.
Check Your Understanding
Use the definitions and calculations in this tutorial to answer the following.
- Why should two groups’ dotplots use the same horizontal scale when the goal is to compare their waiting times?
- For Group A, explain how the median and \(Q_1\) were obtained from the ordered observations.
- For Group B, calculate the upper 1.5-IQR fence and state which observation is flagged.
- Why does the verified 25-minute wait affect the mean more than the median?
- Write one sentence that compares the groups without claiming that one group caused longer waits.