Exploratory Data Analysis · Chapter 1

1C Scratching down numbers / 1D Doing better with stem-and-leaf

Chapter 1 · pages 25–30 · 1798 words

A batch of numbers is simply a set of similar values, however they were gathered — the weights of 21 students, ten years of winter snowfall, mite counts on 49 rats. Just writing them down as a raw list is a start, but it does not let you feel their shape "as a whole." The first improvement is a tally: for the number of cars listed in 18 used-car ads (6,7,7,3,5,7,3,11,16,4,17,17,6,7,9,4,7,5), you list every possible value from 3 to 17 down the page and mark each occurrence next to its value:

3 | X X
4 | X X
5 | X X
6 | X X
7 | X X X X X
8 |
9 | X
...
16 | X
17 | X X

A small refinement replaces each "X" with the actual last digit of the number being tallied — this "digit-reminder" form gives the eye a bit more to grasp and doubles as a check that each mark landed on the right line:

3 | 33
4 | 44
5 | 55
6 | 66
7 | 77777
9 | 9
11 | 1
16 | 6
17 | 77

To make bold-face entries (used elsewhere to distinguish kinds of entries) work on paper rather than in print, the book recommends two colors where practical (a four-color ballpoint is handy), or pen-for-bold/pencil-for-not-bold as a fallback, or, as a last resort, circling entries — more work and less clear.

Tallying breaks down once the range of values is too wide relative to the count of values — cutting used-Chevrolet prices from \$150 to \$1895 in single-dollar steps would need 1746 lines to display only 17 prices. The fix is to let each line absorb a range of possible values instead of just one: lines can be grouped by twos, threes, or tens. When you condense ten possible raw values onto each stem, and abbreviate the label, you get what the book calls a simple stem-and-leaf display — for the car-count data, condensing by tens gives two lines that already show the whole batch:

0* | 33445566777779
1* | 1677

In this display each line is a stem, and each digit written after the stem's label is a leaf; the label itself (the digits shared by every value on that line) is the starting part. One-digit leaves are preferred when they suffice, though two- or more-digit leaves are sometimes worthwhile. Every stem-and-leaf display is expressed in some unit — for Chevrolet prices, using a \$10 unit turns \$250 into "25", shown as stem 2\* with leaf 5. Values that don't divide evenly (like \$1099) can either be cut (truncated, e.g. to 109) or rounded (e.g. to 110); the book leaves the choice open here, as it did earlier. Comparing the same 17 Chevrolet prices at three unit sizes — \$100 (a plain check-off tally), \$10 (one-digit-leaf stem-and-leaf), and \$1 (two-digit-leaf stem-and-leaf) — shows that all three convey much the same overall picture, detail increases from the coarsest to the finest, and the cost of that extra detail is small going from \$100 to \$10 units but can be more noticeable going from \$10 to \$1 units. That's why the \$10-unit or \$1-unit style (or both together) is usually the sensible choice.

Because errors made while scratching down a stem-and-leaf are easy to make and painful to find later, checking matters — but not too much checking, or you spend your time debugging the checks themselves. The minimum recommended check is simply confirming the number of leaf-entries equals the number of original values, kept track of with a "(check count)" column. To count many leaves on one stem quickly, the book recommends covering the leaf-string in blocks of three digits at a time with your forefinger, counting "3, 6, 9, ..." as you go, then adding any digits left uncovered at the end. If the count comes out wrong, you re-walk the original data placing a dot over each leaf already verified correct, to isolate the mistake.

Exhibits and original pages (5)page 25page 26page 27page 28page 29

Study 6 questions →