Lesson 1.4 · Unit 1 · CED topic 1.5
Graphs for one quantitative variable
A quantitative variable gives you a whole range of numbers, and the first thing to do with them is look. A graph shows where the values pile up, how far they stretch, and whether anything unusual is going on, all of which a single summary number can hide. This lesson builds the three standard graphs for one quantitative variable: the dotplot, the stem-and-leaf plot and the histogram. The next lesson teaches you how to describe what they show.
Throughout the lesson we use one data set: the commute times, in minutes, of 30 students at a school.
5, 8, 10, 10, 12, 12, 14, 15, 15, 15, 16, 18, 18, 20, 20, 22, 22, 25, 25, 26, 28, 30, 32, 35, 38, 40, 45, 55, 60, 90
Learning objective.
- 1.5.A. Construct quantitative one-variable graphical representations.
Essential knowledge.
- 1.5.A.1. Histograms, stem-and-leaf plots, and dotplots provide a visual representation of the distribution of the values of a quantitative variable. These graphs show the frequency or relative frequency of the quantitative variable values or intervals of values and maintain the natural ordering, smallest to largest, of the quantitative variable.
- 1.5.A.2. A histogram places the observed values of the quantitative variable into ordered intervals, or bins, along the horizontal axis. Each bar represents an interval or bin, and the height of each bar shows the frequency or relative frequency of the observations within that interval. Altering the interval widths, or bin widths, can change the appearance of the histogram. Alternatively, a histogram can be constructed with bins on the vertical axis with bars appearing horizontally.
- 1.5.A.3. A stem-and-leaf plot splits each value of the quantitative variable into two parts: a “stem” (the first digit or digits) and a “leaf” (usually the single digit after the stem digit or digits). Both stems and leaves are ordered from smallest to largest.
- 1.5.A.4. A dotplot represents each value of the quantitative variable by a dot. Each dot is placed above the horizontal or beside the vertical axis corresponding to the value of that observation, with nearly identical values stacked on top of each other.
What the three graphs have in common
Histograms, stem-and-leaf plots and dotplots give a visual representation of the distribution of the values of a quantitative variable: which values occur and how often. They show the frequency or relative frequency of the values (or of intervals of values), and they maintain the natural ordering, smallest to largest, of the variable. That is what separates them from a bar chart, whose categories have no order.
Dotplots
A dotplot represents each value of the quantitative variable by a dot. Each dot is placed above the horizontal axis (or beside the vertical axis) at the value of that observation, and nearly identical values are stacked on top of each other. Dotplots are quick to make by hand and show every individual value, which makes them best for small and moderate data sets.
In Figure 1.6 the stack of three dots at 15 minutes means three students commute 15 minutes. The distribution is concentrated between about 10 and 30 minutes and has a long tail of longer commutes, with the single dot at 90 well away from the rest.
Stem-and-leaf plots
A stem-and-leaf plot splits each value into two parts: a stem (the first digit or digits) and a leaf (usually the single digit after the stem digits). Both the stems and the leaves are listed in order from smallest to largest, and a key explains how to read them.
The row "2 | 0 0 2 2 5 5 6 8" stands for the eight commute times 20, 20, 22, 22, 25, 25, 26 and 28. Turn the page sideways and the leaves form a histogram, but unlike a histogram the plot keeps every individual value. A stem-and-leaf plot needs a key, and a stem that has no leaves (stems 7 and 8 above) must still be listed so the gap is visible. For data with two digits plus a decimal, such as 6.4 or 6.9, use the whole number as the stem and the decimal as the leaf. When too many values share one stem, you can split each stem into two lines (leaves 0 to 4 and leaves 5 to 9).
Histograms
A histogram places the observed values into ordered intervals, or bins, along the horizontal axis. Each bar represents one bin, and the height of each bar shows the frequency or relative frequency of the observations in that bin. Because the variable is numerical, the bars touch, unlike a bar chart.
A convention to know: each bin includes its left endpoint and excludes its right endpoint, so a commute of exactly 20 minutes is counted in the bin from 20 up to (but not including) 30. In Figure 1.8 the bins are 10 minutes wide and the counts are 2, 11, 8, 4, 2, 1, 1, 0, 0 and 1 (these add to 30). A histogram can also be drawn with the bins on the vertical axis and horizontal bars. If the bars show relative frequencies instead of counts, the shape is identical and only the vertical scale changes.
Bin width changes the picture
Altering the interval widths, or bin widths, can change the appearance of a histogram. Look at the same 30 values with bins 5 minutes wide and with bins 20 minutes wide.
Narrow bins show detail but can look ragged, with small gaps and bumps that are only chance. Wide bins smooth the picture but can hide features: with bins 20 wide, the isolated 90-minute commute is merged into a bar that also holds 60. There is no single correct bin width. Choose one that is wide enough that the shape is not jagged and narrow enough that clusters and gaps still show, and be careful about reading too much into small features.
Press STAT, choose 1:Edit and type the 30 values in list L1. Press 2nd and Y= (STAT PLOT), choose Plot1, turn it On, set Type to the histogram icon (third icon in the top row) with Xlist L1 and Freq 1. Press WINDOW and set Xmin = 0, Xmax = 100, Xscl = 10: Xmin is where the first bin starts and Xscl is the bin width. Press GRAPH. Use TRACE to read each bar's bin and count, and change Xscl to see how bin width affects the picture. ZoomStat picks a window automatically but its bins may not start at a convenient number.
Which graph to use
| Graph | Best for | Keeps individual values? |
|---|---|---|
| Dotplot | Small or moderate data sets; seeing gaps, clusters, outliers | Yes (to the precision of the axis) |
| Stem-and-leaf | Small data sets (up to about 50 values) | Yes, exactly |
| Histogram | Any size, especially large data sets | No, only counts in each bin |
Sixteen students' scores on a quiz were 52, 67, 71, 58, 63, 49, 75, 66, 61, 70, 55, 68, 74, 60, 64 and 62. Make a stem-and-leaf plot.
Put the data in order: 49, 52, 55, 58, 60, 61, 62, 63, 64, 66, 67, 68, 70, 71, 74, 75. Use the tens digit as the stem and the ones digit as the leaf.
| Stem | Leaves |
|---|---|
| 4 | 9 |
| 5 | 2 5 8 |
| 6 | 0 1 2 3 4 6 7 8 |
| 7 | 0 1 4 5 |
Key: \(6\mid3\) means a score of 63. The counts of leaves are \(1+3+8+4=16\), so every value is there. The plot shows that most scores are in the 60s and that the scores trail off a bit toward the lower end.
Forty students were asked how many minutes they spent on homework one night. The counts in bins 0 to under 10, 10 to under 20, 20 to under 30, 30 to under 40 and 40 to under 50 minutes were 4, 12, 14, 8 and 2. Find the relative frequencies and draw the histogram described.
The relative frequencies are \(4/40=0.10\), \(12/40=0.30\), \(14/40=0.35\), \(8/40=0.20\) and \(2/40=0.05\) (the sum is 1). The histogram has five touching bars, each 10 minutes wide, with heights 4, 12, 14, 8, 2 for frequency (or 0.10, 0.30, 0.35, 0.20, 0.05 for relative frequency). The highest bar is the 20 to under 30 minute bin, and 35% of the students are in it.
In the commute data, how many students are in the bin from 10 up to 20 minutes with bins 10 wide? How does that compare with the bin from 0 up to 20 with bins 20 wide?
With width 10, the bin [10, 20) holds the values 10, 10, 12, 12, 14, 15, 15, 15, 16, 18 and 18, which is 11 students. With width 20, the bin [0, 20) holds those 11 values together with 5 and 8 (the two shorter commutes), which is 13 students. The shape of the picture changes with the bin width: the width-10 histogram has a clear peak in the 10 to 20 bin, while the width-20 histogram has two nearly equal bars (13 and 12) and no clear single peak.
- Dotplots, stem-and-leaf plots and histograms show the distribution of one quantitative variable and keep the numerical order.
- A histogram has touching bars over bins (left endpoint included), with height = frequency or relative frequency; changing the bin width can change the appearance.
- A stem-and-leaf plot needs a key and ordered stems and leaves; list empty stems so gaps show.
- Do not use a bar chart for a quantitative variable and do not leave gaps between histogram bars.
- Make a stem-and-leaf plot for 23, 31, 27, 35, 22, 41, 29, 33, 28, 36, 25 and 30.
Show answer
Order: 22, 23, 25, 27, 28, 29, 30, 31, 33, 35, 36, 41. Stems 2: leaves 2 3 5 7 8 9; stem 3: leaves 0 1 3 5 6; stem 4: leaf 1. Key: \(3\mid1=31\). (6 + 5 + 1 = 12 values.)
- Place the values 8, 10, 12, 19, 20, 21, 29, 30, 30 and 41 in bins of width 10 starting at 0 (each bin includes its left endpoint). How many values are in each bin?
Show answer
\([0,10)\): 8, so 1. \([10,20)\): 10, 12, 19, so 3. \([20,30)\): 20, 21, 29, so 3. \([30,40)\): 30, 30, so 2. \([40,50)\): 41, so 1. The total is \(1+3+3+2+1=10\).
- A histogram of 30 values has bars with frequencies 4, 9, 12 and 5. Give the relative frequency for each bar.
Show answer
\(4/30\approx0.133\), \(9/30=0.300\), \(12/30=0.400\), \(5/30\approx0.167\), which add to 1 (up to rounding).
- Why is a histogram's bar chart-like appearance not a reason to leave gaps between its bars?
Show answer
The horizontal axis of a histogram is a numerical scale divided into continuous intervals, so adjacent bins touch. A bar chart is for categorical data, whose categories are separate and unordered, so its bars are separated.
- A researcher has the exact scores of 14 students and wants to show every score and keep their order. Which graph is best, a histogram or a stem-and-leaf plot, and why?
Show answer
The stem-and-leaf plot (or a dotplot): with only 14 values it shows each score exactly, while a histogram would show only how many fall in each interval.
- One student draws a histogram of 400 test scores with bins 1 point wide and says it is too jagged to show a shape. Another uses bins 50 points wide and sees only two bars. What should each student change?
Show answer
The first student should use wider bins so random bumps are smoothed and the overall shape is visible. The second should use narrower bins so the features of the distribution (peaks, gaps, outliers) are not hidden. A middle bin width usually works best.