プリンキピア

第8章統計学

Organizing Dataデータを整理する

Once data have been collected, we turn our attention to analysis. Before we analyze, though, it’s useful to reorganize the data into a format that makes the analysis easier. For example, if our data were collected using a paper survey, our raw data are all broken down by respondent (represented by an individual response sheet). To perform an analysis on all the responses to an individual question, we need to first group all the responses to each question together. The way we organize the data depends on the type of data we’ve collected.
英語のヒント
データを集めたら、分析に目を向ける。しかし、分析の前に、分析しやすい形式にデータを整理し直すと役に立つ。たとえば、紙の調査でデータを集めたなら、生データはすべて回答者ごと(個々の回答用紙で表される)に分かれている。1つの質問へのすべての回答を分析するには、まずそれぞれの質問へのすべての回答をまとめる必要がある。データの整理の仕方は、集めたデータの種類による。
There are two broad types of data: categorical and quantitative. Categorical data classifies the unit into a group (or category). Examples of categorical data include a response to a yes-or-no question, or the color of a person’s eyes. Quantitative data is a numerical measure of a property of a unit. Examples of quantitative data include the time it takes for a rat to run through a maze or a person’s daily calorie intake. We’ll look at each type of data in turn when considering how best to organize.
英語のヒント
データには大きく2つの種類がある。カテゴリカルデータと量的データである。カテゴリカルデータは単位を集団(カテゴリー)に分類する。カテゴリカルデータの例には、はい・いいえの質問への回答や、人の目の色がある。量的データは単位の性質の数値的な測定である。量的データの例には、ネズミが迷路を走り抜けるのにかかる時間や、人の1日のカロリー摂取量がある。どう整理するのが最もよいかを考えるとき、それぞれの種類のデータを順に見る。

Categorical Data Organizationカテゴリカルデータの整理

The best way to organize categorical data is using a categorical frequency distribution. A categorical frequency distribution is a table with two columns. The first contains all the categories present in the data, each listed once. The second contains the frequencies of each category, which are just a count of how often each category appears in the data.
英語のヒント
カテゴリカルデータを整理する最もよい方法は、カテゴリカル度数分布を使うことである。カテゴリカル度数分布は2列の表である。1列目にはデータにあるすべてのカテゴリーを1回ずつ入れる。2列目にはそれぞれのカテゴリーの度数を入れる。度数とは、それぞれのカテゴリーがデータに現れる回数を数えたものにすぎない。
Example 8.2例題 8.2
Creating a Categorical Frequency Distributionカテゴリカル度数分布を作る
A teacher records the responses of the class (28 students) on the first question of a multiple choice quiz, with five possible responses (A, B, C, D, and E):
英語のヒント
教師が、選択式のテストの1問目へのクラス(28人の生徒)の回答を記録する。ありうる回答は5つ(A、B、C、D、E)である:
AACABBAEACAAAC
EABAACABEEAACC
Create a categorical frequency distribution that organizes the responses.
英語のヒント
回答を整理するカテゴリカル度数分布を作れ。
Solution解答
Step 1: For each possible response, count the number of times that response appears in the data. In the responses for this class, “A” appears 14 times, “B” 4 times, “C” 6 times, “D” 0 times, and “E” 4 times.
英語のヒント
手順1:ありうるそれぞれの回答について、その回答がデータに現れる回数を数える。このクラスの回答では、「A」が14回、「B」が4回、「C」が6回、「D」が0回、「E」が4回現れる。
Step 2: Make a table with two columns. The first column should be labeled so that the reader knows what the responses mean, and the second should be labeled “Frequency.”
英語のヒント
手順2:2列の表を作る。1列目には、読者が回答の意味をわかるように見出しをつけ、2列目には「度数」と見出しをつける。
Response to First Question1問目への回答Frequency度数
A14
B4
C6
D0
E4
Step 3: Check your work. If you add up your frequencies, you should get the same number as the total number of responses. Twenty-eight students answered that first question, and 14+4+6+0+4=28.
英語のヒント
手順3:確かめる。度数を足すと、回答の総数と同じ数になるはずである。28人の生徒がその1問目に答え、14+4+6+0+4=28である。

Quantitative Data量的データ

We have a couple of options available for organizing quantitative data. If there are just a few possible responses, we can create a frequency distribution just like the ones we made for categorical data above. For example, if we’re surveying a group of high school students and we ask for each student’s age, we’ll likely only get whole-number responses between 13 and 19. Since there are only around seven (and likely fewer) possible responses, we can treat the data as if they’re categorical and create a frequency distribution as before.
英語のヒント
量的データの整理には選択肢がいくつかある。ありうる回答が数個だけなら、上のカテゴリカルデータで作ったのと同じように度数分布を作れる。たとえば、高校生の集団を調査して、それぞれの生徒の年齢を尋ねるなら、おそらく13から19までの整数の回答だけが得られる。ありうる回答は7つくらい(おそらくもっと少ない)しかないので、データをカテゴリカルであるかのように扱って、前と同じように度数分布を作れる。
Example 8.3例題 8.3
Creating a Quantitative Frequency Distribution量的度数分布を作る
Attendees of a conflict resolution workshop are asked how many siblings they have. The responses are as follows:
英語のヒント
紛争解決の研修の参加者に、きょうだいが何人いるかを尋ねる。回答は次のとおりである:
101120311412013
121241013012215
Create a frequency distribution to organize the responses.
英語のヒント
回答を整理する度数分布を作れ。
Solution解答
Step 1: Count the number of times you see each unique response: “0” appears 5 times, “1” appears 13 times, “2” appears 6 times, “3” appears 3 times, “4” appears twice, and “5” appears once.
英語のヒント
手順1:それぞれの異なる回答が現れる回数を数える。「0」が5回、「1」が13回、「2」が6回、「3」が3回、「4」が2回、「5」が1回現れる。
Step 2: Make a table with two columns. The first column should be labeled so that the reader knows what the responses mean, and the second should be labeled “Frequency.” Then fill in the results of our count.
英語のヒント
手順2:2列の表を作る。1列目には、読者が回答の意味をわかるように見出しをつけ、2列目には「度数」と見出しをつける。それから数えた結果を入れる。
Number of Siblingsきょうだいの数Frequency度数Number of Siblingsきょうだいの数Frequency度数
0533
11342
2651
Step 3: Check your work. If you add up your counts, you should get the same number as the total number of responses. Looking back at the raw data, there were 30 responses, and 5+13+6+3+2+1=30.
英語のヒント
手順3:確かめる。数えた値を足すと、回答の総数と同じ数になるはずである。生データを見返すと、回答は30あり、5+13+6+3+2+1=30である。
If there are many possible responses, a frequency distribution table like the ones we’ve seen so far isn’t really useful; there will likely be many responses with a frequency of one, which means the table will be no better than looking at the raw data. In these cases, we can create a binned frequency distribution. A binned frequency distribution groups the data into ranges of values called bins, then records the number of responses in each bin.
英語のヒント
ありうる回答が多いなら、これまで見たような度数分布の表はあまり役に立たない。おそらく度数が1の回答が多くなるので、表は生データを見るのと変わらなくなる。このような場合には、階級つき度数分布を作れる。階級つき度数分布は、データを階級と呼ばれる値の範囲に分け、それぞれの階級の回答の数を記録する。
For example, if we have height data for individuals measured in centimeters, we might create bins like 150–155 cm, 155–160 cm, and so forth (making sure that every data value falls into a bin). We must be careful, though; in this scenario, it’s not clear which bin would contain a response of 155 cm. Usually, responses on the edge of a bin are placed in the higher bin, but it’s good practice to make that clear. In cases where responses are rounded off, you can avoid this issue by leaving a gap between the bins that couldn’t contain any responses. In our example, if the measurements were all rounded off to the nearest centimeter, we could make bins like 150–154 cm, 155–159 cm, etc. (since a response like 154.2 isn’t possible). We’ll use this method going forward. How do we decide what the boundaries of our bins should be? There’s no one right way to do that, but there are some guidelines that can be helpful.
英語のヒント
たとえば、個人の身長のデータがセンチメートルで測られているなら、150–155 cm、155–160 cmなどの階級を作るかもしれない(すべてのデータの値がどれかの階級に入るようにする)。ただし、注意が必要である。この場合、155 cmという回答がどの階級に入るかがはっきりしない。ふつう、階級の端の回答は上の階級に入れるが、そのことを明示するのがよいやり方である。回答が丸められている場合は、回答が入りえない隙間を階級のあいだに残すと、この問題を避けられる。この例で、測定値がすべて最も近いセンチメートルに丸められているなら、150–154 cm、155–159 cmなどの階級を作れる(154.2のような回答はありえないので)。今後はこの方法を使う。階級の境界をどう決めるのか。正しい方法は1つではないが、役に立つ指針がいくつかある。
  1. Every data value should fall into exactly one bin. For example, if the lowest value in our data is 42, the lowest bin should not be 45–49.
    英語のヒント
    すべてのデータの値は、ちょうど1つの階級に入るべきである。たとえば、データの最小値が42なら、いちばん下の階級を45–49にすべきではない。
  2. Every bin should have the same width. Note that if we shift the upper limits of our bins down a bit to avoid ambiguity (like described above), we can’t simply subtract the lower limit from the upper limit to get the bin width; instead, we subtract the lower limit of the bin from the lower limit of the next bin. For example, if we’re looking at GPAs rounded to the nearest hundredth, we might choose bins like 2.00–2.24, 2.25–2.49, 2.50–2.74, etc. These bins all have a width of 0.25.
    英語のヒント
    すべての階級は同じ幅にすべきである。あいまいさを避けるために(上で述べたように)階級の上限を少し下げるなら、上限から下限を引くだけでは階級の幅を得られないことに注意しよう。代わりに、次の階級の下限からその階級の下限を引く。たとえば、小数第2位に丸めたGPAを見ているなら、2.00–2.24、2.25–2.49、2.50–2.74などの階級を選ぶかもしれない。これらの階級の幅はすべて0.25である。
  3. If the minimum or maximum value of the data falls right on the boundary between two bins, then it’s OK to bend the rule just a little in order to avoid having an additional bin containing just that one value. We’ll see an example of this in just a moment.
    英語のヒント
    データの最小値や最大値が2つの階級の境界にちょうど当たるなら、その1つの値だけの階級が増えるのを避けるために、この決まりを少し曲げてよい。その例はすぐあとで見る。
  4. If we have too many or too few bins, it can be difficult to get a good sense of the distribution. Seven or eight bins is ideal, but that’s not a firm rule; anything between five and twelve is fine. We often choose the number of bins so that the widths are round numbers.
    英語のヒント
    階級が多すぎたり少なすぎたりすると、分布の様子をつかみにくくなる。7つか8つの階級が理想だが、厳しい決まりではない。5から12のあいだならどれでもよい。幅がきりのよい数になるように階級の数を選ぶことが多い。
Example 8.4例題 8.4
Creating a Binned Frequency Distribution階級つき度数分布を作る
The GPAs of students enrolled in an advanced sociology class are listed in the following table. At this institution, 4.00 is the maximum possible GPA.
英語のヒント
上級の社会学の授業に登録している学生のGPAを次の表に示す。この大学では、4.00が可能な最大のGPAである。
3.933.432.872.512.701.912.322.853.063.033.491.843.722.56
1.993.403.743.231.983.051.432.901.203.723.563.072.584.00
2.793.812.603.692.883.341.513.633.451.892.302.983.042.70
Create a binned frequency distribution for the data.
英語のヒント
データの階級つき度数分布を作れ。
Solution解答
Step 1: Identify the max and min values in your bins. Looking at the dataset, you can see that the lowest value is 1.20, and the highest is 4.00.
英語のヒント
手順1:階級の最大値と最小値を見きわめる。データセットを見ると、最小値は1.20で、最大値は4.00である。
Step 2: Get a rough idea of bin widths. Aim for seven or eight bins, give or take a couple. For eight bins, the minimum width can be found by taking the difference between the largest and smallest data values and dividing by the number of bins:
英語のヒント
手順2:階級の幅のおおよその見当をつける。7つか8つの階級を、前後2つくらいの幅でめざす。8つの階級なら、最小の幅は、データの最大値と最小値の差を階級の数で割って求められる:
maximum-minimum# of bins=4.00-1.208=0.35.
If we use 0.35 for our widths, starting at our minimum value of 1.20, we’ll get bins with these boundaries: 1.20, 1.55, 1.90, 2.25, 2.60, 2.95, 3.30, 3.65, 4.00.
英語のヒント
幅に0.35を使い、最小値の1.20から始めると、次の境界の階級が得られる:1.20、1.55、1.90、2.25、2.60、2.95、3.30、3.65、4.00。
Step 3: Consider the context of the values. Because these are GPAs, there are natural breaks at 2.00 and 3.00 that are important. (People like whole numbers!) Since 0.35 is very close to 13, let’s use that for our bin width instead, and make sure that whole numbers fall on the boundaries. That means our first bin needs to start at 1.00 and go up to 1.33 to make sure our minimum value is included. The next bin will run from 1.34 to 1.66, and so forth.
英語のヒント
手順3:値の文脈を考える。これらはGPAなので、2.00と3.00に重要な自然な区切りがある。(人は整数が好きである!)0.35は13にとても近いので、代わりにそれを階級の幅に使い、整数が境界に来るようにしよう。つまり、最小値が確実に含まれるように、最初の階級は1.00から始めて1.33までにする必要がある。次の階級は1.34から1.66までとなり、以下同様である。
Step 4: Create the distribution table. We start our distribution table by filling in the bins:
英語のヒント
手順4:分布の表を作る。まず階級を入れて分布の表を始める:
GPA RangeGPAの範囲Frequency度数GPA RangeGPAの範囲Frequency度数GPA RangeGPAの範囲Frequency度数
1.00–1.332.00–2.333.00–3.33
1.34–1.662.34–2.663.34–3.66
1.67–1.992.67–2.993.67–4.00
Notice that the last bin doesn’t follow the pattern; since our maximum data value is right on the upper boundary of that last bin, this is a case where we can bend that rule just a little to avoid creating a bin for 4.00–4.33 (which wouldn’t really make sense in the context of these GPAs anyway, since 4.00 is the maximum possible GPA).
英語のヒント
最後の階級がパターンに従っていないことに注意しよう。データの最大値が最後の階級の上の境界にちょうど当たるので、これは4.00–4.33の階級を作らないように決まりを少し曲げてよい場合である(4.00が可能な最大のGPAなので、いずれにしてもこの階級はGPAの文脈では意味をなさない)。
Step 5: Complete the table with the frequencies. Finish the table by counting the number of data values that fall in each bin, and recording them in the frequency column:
英語のヒント
手順5:度数で表を完成させる。それぞれの階級に入るデータの値の数を数え、度数の列に記録して表を仕上げる:
GPA RangeGPAの範囲Frequency度数GPA RangeGPAの範囲Frequency度数GPA RangeGPAの範囲Frequency度数
1.00–1.3312.00–2.3323.00–3.336
1.34–1.6622.34–2.6643.34–3.667
1.67–1.9952.67–2.9983.67–4.007
Step 6: Check your work. Add up the frequencies to make sure all the data values are included. We started with forty-two data values, and 1+2+5+2+4+8+6+7+7=42.
英語のヒント
手順6:確かめる。度数を足して、すべてのデータの値が含まれていることを確かめる。42個のデータの値から始めて、1+2+5+2+4+8+6+7+7=42である。