第8章統計学
Visualizing Quantitative Data量的データを可視化する
There are several good ways to visualize quantitative data. In this section, we’ll talk about two types: stem-and-leaf plots and histograms.
英語のヒント
量的データを可視化するよい方法はいくつかある。この節では2種類を話す。幹葉図とヒストグラムである。
Stem-and-Leaf Plots幹葉図
Stem-and-leaf plots are visualization tools that fall somewhere between a list of all the raw data and a graph. A stem-and-leaf plot consists of a list of stems on the left and the corresponding leaves on the right, separated by a line. The stems are the numbers that make up the data only up to the next-to-last digit, and the leaves are the final digits. There is one leaf for every data value (which means that leaves may be repeated), and the leaves should be evenly spaced across all stems. These plots are really nothing more than a fancy way of listing out all the raw data; as a result, they shouldn’t be used to visualize large datasets.
英語のヒント
幹葉図は、すべての生データの一覧とグラフの中間にあたる可視化の道具である。幹葉図は、左の幹の一覧と右の対応する葉でできていて、線で分けられている。幹はデータを作る数のうち下から2桁目までで、葉は最後の桁である。データの値1つにつき葉が1つあり(つまり葉は繰り返されることがある)、葉はすべての幹にわたって等間隔にする。この図は、すべての生データを書き出す凝った方法にすぎない。その結果、大きなデータセットの可視化に使うべきではない。
This concept can be difficult to understand without referencing an example, so let’s first look at how to read a stem-and-leaf plot.
英語のヒント
この考えは例を見ないと理解しにくいので、まず幹葉図の読み方を見よう。
Example 8.9例題 8.9
Reading a Stem-and-Leaf Plot幹葉図を読む
A collector of trading cards records the sale prices (in dollars) of a particular card on an online auction site, and puts the results in a stem-and-leaf plot:
英語のヒント
トレーディングカードの収集家が、オンラインのオークションサイトでのあるカードの販売価格(ドル)を記録し、結果を幹葉図にまとめる:
| 0 | 5 8 9 |
| 1 | 0 0 0 3 4 4 5 5 5 5 6 9 9 |
| 2 | 0 0 0 0 5 5 9 9 |
| 3 | 0 0 0 5 5 |
| 4 | 0 0 5 |
| 5 | |
| 6 | 0 |
Answer the following questions about the data:
英語のヒント
データについて次の問いに答えよ:
- How many prices are represented?
英語のヒント
いくつの価格が表されているか。 - What prices represent the five most expensive cards? The five least expensive?
英語のヒント
どの価格がいちばん高い5枚のカードを表すか。いちばん安い5枚は。 - What is the full set of data?
英語のヒント
データの全体は何か。
Solution解答
- Each leaf (the numbers on the right side of the bar) represents one data value. So, on the first row (which looks like 0 | 5 8 9), there are three data values (one for each leaf: 5, 8, and 9). The next row has thirteen leaves, then eight, five, three, zero, and one. Adding those up, we get data points or prices.
英語のヒント
それぞれの葉(線の右側の数)は1つのデータの値を表す。だから、最初の行(0 | 5 8 9のように見える)には3つのデータの値がある(葉5、8、9に1つずつ)。次の行には葉が13あり、次は8、5、3、0、1である。これらを足すと、個のデータ点、つまり価格が得られる。 - The most expensive card is the last one listed. Its stem is 6 and its leaf is 0, so the price is $60. There are no leaves associated with the 5 stem, so there were no cards sold for $50 to $59. The next most expensive cards are then on the 4 stem: $45, $40, and $40 (remember, repeated leaves mean repeated values in the dataset). So, we have our four most expensive cards. The fifth would be on the next stem up. The biggest leaf on the 3 stem is a 5, so the fifth-most expensive card sold for $35.
As for the five least-expensive cards, the smallest stem is 0, with leaves 5, 8, and 9. So, the three least expensive cards sold for $5, $8, and $9 (notice that we don’t write down that leading 0 from the stem in the tens place). The next two least-expensive cards will be the two smallest leaves on the next stem: $10 and $10.英語のヒント
いちばん高いカードは最後に挙げられたものである。幹は6で葉は0なので、価格は60ドルである。幹5には葉がないので、50ドルから59ドルで売れたカードはなかった。次に高いカードは幹4にある。45ドル、40ドル、40ドルである(繰り返された葉はデータセットで値が繰り返されていることを思い出そう)。これで高いほうから4枚のカードがわかった。5枚目は次の幹にある。幹3でいちばん大きい葉は5なので、5番目に高いカードは35ドルで売れた。いちばん安い5枚のカードについては、いちばん小さい幹は0で、葉は5、8、9である。だから、いちばん安い3枚のカードは5ドル、8ドル、9ドルで売れた(十の位の幹の先頭の0は書かないことに注意しよう)。次に安い2枚のカードは次の幹の小さいほうから2枚の葉で、10ドルと10ドルである。 - The full list of data is: 5, 8, 9, 10, 10, 10, 13, 14, 14, 15, 15, 15, 15, 16, 19, 19, 20, 20, 20, 24, 25, 25, 29, 29, 30, 30, 30, 35, 35, 40, 40, 45, 60.
英語のヒント
データの全体の一覧は次のとおりである:5, 8, 9, 10, 10, 10, 13, 14, 14, 15, 15, 15, 15, 16, 19, 19, 20, 20, 20, 24, 25, 25, 29, 29, 30, 30, 30, 35, 35, 40, 40, 45, 60。
Stem-and-leaf plots are useful in that they give us a sense of the shape of the data. Are the data evenly spread out over the stems, or are some stems “heavier” with leaves? Are the heavy stems on the low side, the high side, or somewhere in the middle? These are questions about the distribution of the data, or how the data are spread out over the range of possible values.
英語のヒント
幹葉図は、データの形の見当を与えてくれる点で役に立つ。データは幹にわたって均等に広がっているか、それとも葉で「重い」幹があるか。重い幹は低いほう、高いほう、または真ん中のどこかにあるか。これらは、データの分布、つまりデータがありうる値の範囲にどう広がっているかについての問いである。
Some words we use to describe distributions are uniform (data are equally distributed across the range), symmetric (data are bunched up in the middle, then taper off in the same way above and below the middle), left-skewed (data are bunched up at the high end or larger values, and taper off toward the low end or smaller values), and right-skewed (data are bunched up at the low end, and taper off toward the high end). See below figures.
英語のヒント
分布を表すのに使う言葉には、一様(データが範囲にわたって均等に分布している)、対称(データが真ん中に集まり、真ん中の上下で同じように減っていく)、左に歪んだ(データが高いほう、つまり大きい値に集まり、低いほう、つまり小さい値に向かって減っていく)、右に歪んだ(データが低いほうに集まり、高いほうに向かって減っていく)がある。下の図を見よ。

Looking back at the stem-and-leaf plot in the previous example, we can see that the data are bunched up at the low end and taper off toward the high end; that set of data is right-skewed. Knowing the distribution of a set of data gives us useful information about the property that the data are measuring.
英語のヒント
前の例題の幹葉図を見返すと、データは低いほうに集まり、高いほうに向かって減っていくことがわかる。そのデータの集まりは右に歪んでいる。データの集まりの分布を知ると、データが測っている性質について役に立つ情報が得られる。
Now that we have a better idea of how to read a stem-and-leaf plot, we’re ready to create our own.
英語のヒント
幹葉図の読み方がよくわかったので、自分で作る用意ができた。
Example 8.10例題 8.10
Constructing a Stem-and-Leaf Plot幹葉図を作る
An entomologist studying crickets recorded the number of times different crickets (of differing species, genders, etc.) chirped in a one-minute span. The raw data are as follows:
英語のヒント
コオロギを研究する昆虫学者が、いろいろなコオロギ(種や性別などが異なる)が1分間に鳴いた回数を記録した。生データは次のとおりである:
| 89 | 97 | 82 | 102 | 84 | 99 | 93 | 103 | 120 | 91 |
| 115 | 105 | 89 | 109 | 107 | 89 | 104 | 82 | 106 | 92 |
| 101 | 109 | 116 | 103 | 100 | 91 | 85 | 104 | 104 | 106 |
Construct a stem-and-leaf plot to visualize these results.
英語のヒント
これらの結果を可視化する幹葉図を作れ。
Solution解答
Step 1: Before we can create the plot, we need to sort the data in order from smallest to largest:
英語のヒント
手順1:図を作る前に、データを小さい順に並べる必要がある:
| 82 | 82 | 84 | 85 | 89 | 89 | 89 | 91 | 91 | 92 |
| 93 | 97 | 99 | 100 | 101 | 102 | 103 | 103 | 104 | 104 |
| 104 | 105 | 106 | 106 | 107 | 109 | 109 | 115 | 116 | 120 |
Step 2: Next, we identify the stems. To do that, we cut off the final digit of each number, which leaves us with stems of 8, 9, 10, 11, and 12. Arrange the stems vertically, and add the bar to separate these from the leaves:
英語のヒント
手順2:次に、幹を見きわめる。それには、それぞれの数の最後の桁を切り落とす。すると幹は8、9、10、11、12になる。幹を縦に並べ、葉と分ける線を加える:
| 8 |
| 9 |
| 10 |
| 11 |
| 12 |
Step 3: Write down the leaves on the right side of the bar, giving just the final digit (that we cut off to make the stems) of each data value. List these in order, and make sure they line up vertically:
英語のヒント
手順3:線の右側に葉を書く。それぞれのデータの値の最後の桁(幹を作るときに切り落とした)だけを書く。これらを順に並べ、縦にそろうようにする:
| 8 | 2 2 4 5 9 9 9 |
| 9 | 1 1 2 3 7 9 |
| 10 | 0 1 3 3 4 4 4 5 6 6 7 9 9 |
| 11 | 5 6 |
| 12 | 0 |
As we mentioned above, stem-and-leaf plots aren’t always going to be useful. For example, if all the data in your dataset are between 20 and 29, then you’ll just have one stem, which isn’t terribly useful. (Although there are methods like stem splitting for addressing that particular problem, we won’t go into those at this time.) On the other end of the spectrum, the data may be so spread out that every stem has only one leaf. (This problem can sometimes be addressed by rounding off the data values to the tens, hundreds, or some other place value, then using that place for the leaves.) Finally, if you have dozens or hundreds (or more) of data values, then a stem-and-leaf plot becomes too unwieldy to be useful. Fortunately, we have other tools we can use.
英語のヒント
上で述べたように、幹葉図がいつも役に立つわけではない。たとえば、データセットのすべてのデータが20と29のあいだなら、幹は1つだけになり、あまり役に立たない。(その問題に対処する幹の分割のような方法があるが、ここでは立ち入らない。)反対の端では、データが広がりすぎて、どの幹にも葉が1つしかないことがある。(この問題は、データの値を十の位、百の位などに丸め、その位を葉に使うと対処できることがある。)最後に、データの値が数十、数百(またはもっと)あると、幹葉図は扱いにくくて役に立たなくなる。幸い、使える道具がほかにある。
Histogramsヒストグラム
Histograms are visualizations that can be used for any set of quantitative data, no matter how big or spread out. They differ from a categorical bar chart in that the horizontal axis is labeled with numbers (not ranges of numbers), and the bars are drawn so that they touch each other. The heights of the bars reflect the frequencies in each bin. Unlike with stem-and-leaf plots, we cannot recreate the original dataset from a histogram. However, histograms are easy to make with technology and are great for identifying the distribution of our data. Let’s first create one histogram without technology to help us better understand how histograms work.
英語のヒント
ヒストグラムは、どれだけ大きくても広がっていても、どんな量的データの集まりにも使える可視化である。カテゴリカルな棒グラフとの違いは、横軸に(数の範囲ではなく)数のラベルがつき、棒が互いに接するように描かれることである。棒の高さはそれぞれの階級の度数を反映する。幹葉図と違って、ヒストグラムからもとのデータセットを作り直すことはできない。しかし、ヒストグラムは計算機器で簡単に作れて、データの分布を見きわめるのにとてもよい。ヒストグラムの仕組みをよく理解するために、まず計算機器なしでヒストグラムを1つ作ろう。
Example 8.11例題 8.11
Constructing a Histogramヒストグラムを作る
In Example 8.10, we built a stem-and-leaf plot for the number of chirps made by crickets in one minute. Here are the raw data that we used then:
英語のヒント
例題8.10で、コオロギが1分間に鳴く回数の幹葉図を作った。そのとき使った生データは次のとおりである:
| 89 | 97 | 82 | 102 | 84 | 99 |
| 115 | 105 | 89 | 109 | 107 | 89 |
| 101 | 109 | 116 | 103 | 100 | 91 |
| 93 | 103 | 120 | 91 | 85 | 104 |
| 104 | 82 | 106 | 92 | 104 | 106 |
Construct a histogram to visualize these results.
英語のヒント
これらの結果を可視化するヒストグラムを作れ。
Solution解答
Step 1: Add data to bins. Histograms are built on binned frequency distributions, so we’ll make that first. Luckily, the stem-and-leaf plot we made earlier can help us do this much more quickly:
英語のヒント
手順1:データを階級に入れる。ヒストグラムは階級つき度数分布にもとづくので、まずそれを作る。幸い、前に作った幹葉図を使うと、これをずっと速くできる:
| 8 | 2 2 4 5 9 9 9 |
| 9 | 1 1 2 3 7 9 |
| 10 | 0 1 2 3 3 4 4 4 5 6 6 7 9 9 |
| 11 | 5 6 |
| 12 | 0 |
If we’re using bins of width 10, we can compute the frequencies by counting the numbers of leaves associated with the corresponding stem:
英語のヒント
幅10の階級を使うなら、対応する幹の葉の数を数えて度数を計算できる:
| Bin階級 | Frequency度数 |
|---|---|
| 80-89 | 7 |
| 90-99 | 6 |
| 100-109 | 14 |
| 110-119 | 2 |
| 120-129 | 1 |
(Note that, when we made binned frequency diagrams in the last module, we noted that if the biggest data value was right on the border between two bins, it was OK to lump it in with the lower bin. That’s not recommended when building histograms, so the data value 120 is all alone in the 120-129 bin.)
英語のヒント
(前の節で階級つき度数分布を作ったとき、最大のデータの値が2つの階級の境界にちょうど当たるなら、下の階級に入れてもよいと述べたことに注意しよう。ヒストグラムを作るときはそれを勧めないので、データの値120は120-129の階級に1つだけ入る。)
Step 2: Create the axes. On the horizontal axis, start labeling with the lower end of the first bin (in this case, 80), and go up to the higher end of the last bin (120). Mark off the other bin boundaries, making sure they’re all evenly spaced. On the vertical axis, start with zero and go up at least to the greatest frequency you see in your bins (14 in this example), making sure that the labels you make are evenly spaced and that the difference between those numbers is the same. Let’s count off our vertical axis by threes:
英語のヒント
手順2:軸を作る。横軸には、最初の階級の下端(この場合は80)からラベルをつけ始め、最後の階級の上端(120)まで行く。ほかの階級の境界に印をつけ、すべて等間隔になるようにする。縦軸には、0から始めて少なくとも階級の最大の度数(この例では14)まで行く。つけるラベルが等間隔で、それらの数の差が同じになるようにする。縦軸は3ずつ数えよう:

Figure 8.17図8.17
Step 3: Draw in the bars. Remember that the bars of a histogram touch, and that the heights are determined by the frequency. So, the first bar will cover 80 to 90 on the horizontal axis, and have a height of 7:
英語のヒント
手順3:棒を描く。ヒストグラムの棒は接し、高さは度数で決まることを思い出そう。だから、最初の棒は横軸の80から90までを覆い、高さは7である:

Figure 8.18図8.18
Now, we can fill in the others:
英語のヒント
では、ほかを埋められる:

Figure 8.19図8.19
Step 4: Let’s compare the histogram we just created to the stem-and-leaf plot we made earlier:
英語のヒント
手順4:いま作ったヒストグラムと、前に作った幹葉図を比べよう:

Figure 8.20図8.20
Notice that the leaves on the rotated stem-and-leaf plot match the bars on our histogram! We can view stem-and-leaf plots as sideways histograms. But, as we’ll see soon, we can do much more with histograms.
英語のヒント
回転させた幹葉図の葉がヒストグラムの棒と一致することに注意しよう!幹葉図は横向きのヒストグラムと見なせる。しかし、すぐに見るように、ヒストグラムではもっと多くのことができる。
Now that we’ve seen the connection between stem-and-leaf plots and histograms, we are ready to look at how we can use Google Sheets to build histograms.
英語のヒント
幹葉図とヒストグラムのつながりを見たので、Google Sheetsを使ってヒストグラムを作る方法を見る用意ができた。
Let’s use Google Sheets to create a histogram for a large dataset.
英語のヒント
Google Sheetsを使って大きなデータセットのヒストグラムを作ろう。
Example 8.12例題 8.12
Creating a Histogram in Google SheetsGoogle Sheetsでヒストグラムを作る
The data in “AvgSAT” contains the average SAT score for students attending every institution of higher learning in the US for which data is available. Create a histogram in Google Sheets of the average SAT scores. Use bins of width 50. Are the data uniformly distributed, symmetric, left-skewed, or right-skewed?
英語のヒント
「AvgSAT」のデータは、データのあるアメリカのすべての高等教育機関に通う学生のSATの平均点を含む。平均SATのヒストグラムをGoogle Sheetsで作れ。幅50の階級を使え。データは一様に分布しているか、対称か、左に歪んでいるか、右に歪んでいるか。
Solution解答
Using the procedure described in the video above, we get this:
英語のヒント
上の動画で説明した手順を使うと、次が得られる:

Figure 8.21図8.21
(data source: https://data.ed.gov)
英語のヒント
(データ出典:https://data.ed.gov)
The data are fairly symmetric, but slightly right-skewed.
英語のヒント
データはかなり対称だが、わずかに右に歪んでいる。
Bar Charts for Labeled Dataラベルつきデータの棒グラフ
Sometimes we have quantitative data where each value is labeled according to the source of the data. For example, in the Your Turn above, you looked at in-state tuition data. Every value you used to create that histogram was associated with a school; the schools are the labels. In YOUR TURN 8.11, you found a histogram of the wins of every Major League Baseball team in 2019. Each of those win totals had a label: the team. If we’re interested in visualizing differences among the different teams, or schools, or whatever the labels are, we create a different version of the bar graph known as a bar chart for labeled data.
英語のヒント
それぞれの値にデータの出どころのラベルがついた量的データもある。たとえば、上の「やってみよう」では州内学費のデータを見た。そのヒストグラムを作るのに使ったどの値も学校に結びついていて、学校がラベルである。やってみよう8.11では、2019年のメジャーリーグのすべてのチームの勝ち数のヒストグラムを求めた。それらの勝ち数にはそれぞれラベルがあった。チームである。異なるチーム、学校、そのほかのラベルのあいだの違いを可視化したいなら、ラベルつきデータの棒グラフとして知られる棒グラフの別の形を作る。
These graphs are made in Google Sheets in exactly the same way as regular bar graphs. The only change is that the vertical axis will be labeled with the units for your quantitative data instead of just “Frequency.”
英語のヒント
これらのグラフは、Google Sheetsでふつうの棒グラフとまったく同じように作る。唯一の変更は、縦軸のラベルが単なる「度数」ではなく量的データの単位になることである。
Example 8.13例題 8.13
Building a Bar Chart for Labeled Dataラベルつきデータの棒グラフを作る
The following table shows the gross domestic product (GDP) for the United States for the years 2010 to 2019:
英語のヒント
次の表は、2010年から2019年までのアメリカの国内総生産(GDP)を示している:
| Year年 | GDP (in $ trillions)GDP(兆ドル) | Year年 | GDP (in $ trillions)GDP(兆ドル) |
|---|---|---|---|
| 2010 | 14.992 | 2015 | 18.225 |
| 2011 | 15.543 | 2016 | 18.715 |
| 2012 | 16.197 | 2017 | 19.519 |
| 2013 | 16.785 | 2018 | 20.580 |
| 2014 | 17.527 | 2019 | 21.433 |
Construct a histogram that represents these data.
英語のヒント
これらのデータを表すヒストグラムを作れ。
Solution解答
In this case, the years are the labels, and the data we are interested in are the GDP numbers. Once you have the table above (including the labels) entered into a spreadsheet, click and drag to select the full table. Then, in the “Insert” menu, click “Chart.” The result may not be a bar chart; if it’s not, select “Column chart” in the drop-down menu “Chart type” in the Chart Editor. If you want, you can edit things like the chart title in the “Customize” tab in the Chart Editor.
英語のヒント
この場合、年がラベルで、関心のあるデータはGDPの数値である。上の表(ラベルを含む)をスプレッドシートに入力したら、クリックしてドラッグし、表全体を選ぶ。次に、「挿入」メニューで「グラフ」をクリックする。結果は棒グラフでないかもしれない。そうでなければ、グラフエディタの「グラフの種類」のドロップダウンメニューで「縦棒グラフ」を選ぶ。必要なら、グラフエディタの「カスタマイズ」タブでグラフのタイトルなどを編集できる。

Figure 8.22図8.22
(data source: https://data.worldbank.org)
英語のヒント
(データ出典:https://data.worldbank.org)