統計で英語多読 2-6: 2変数の関係① — 散布図と共分散で関係性の向きを知る
散布図と共分散を題材にした英語多読ユニット。約950語の英文と全文日本語訳で、2変数の関係の向き・形・強さの見方と共分散の限界をたどります。
「大人のための英語多読図書館」へようこそ。今回は、2つの変数が一緒に動くかどうかを、散布図で目に見える形にし、共分散という数値で関係の「向き」をとらえる方法を、英語の文章でたどっていきます。
📊 このユニットの情報 語数: 約950語 / 推定読了時間: 6〜10分 / 難易度: ★★☆☆☆(初中級)
Learning Objectives
みなさんこんにちは。大人のための英語多読図書館へようこそ。
これまでの章では、身長、テストの点数、気温など、1つの変数(single variable) の特徴(平均値や散らばりなど)を見てきました。
しかし、私たちが知りたいことの多くは、2つの変数の関係性 です。「勉強時間(変数A)が増えると、テストの点数(変数B)は上がるのか?」「気温(変数A)が上がると、アイスクリームの売上(変数B)は増えるのか?」といったことです。
このように2つの変数をペアで扱うデータを2変量データ (bivariate data) と呼びます。
今回は、この2つの変数の関係性を分析する第一歩として、 1. 関係性を目で見て確認するグラフである「散布図 (Scatter Plot)」 2. 関係性の「向き」を数値で表す「共分散 (Covariance)」 について学びます。
それでは今回も多読を楽しんでいきましょう。
Summary
- We analyze the relationship between two quantitative variables (bivariate data) to see if they move together.
- A Scatter Plot is a graph that visually represents this relationship. Each pair of data \((x, y)\) is plotted as a single point.
- Scatter plots help us identify the direction (positive or negative), form (linear or curved), and strength (strong or weak) of a relationship.
- Positive association means that as one variable increases, the other variable tends to increase (points trend upwards).
- Negative association means that as one variable increases, the other variable tends to decrease (points trend downwards).
- Covariance is a numerical measure that indicates the direction of the linear relationship between two variables.
- A positive covariance indicates a positive association. A negative covariance indicates a negative association. A covariance near zero suggests no linear relationship.
Explanation
From One Variable to Two
So far, we have focused on univariate data (one variable). We learned to describe its center (mean, median) and its spread (variance, standard deviation).
Now, we move to bivariate data (two variables). Our main question is: Do these two variables move together?
For example, let's collect data from 10 students: - Variable \(X\): Hours spent studying per week - Variable \(Y\): Score on the final exam
Does \(Y\) tend to increase when \(X\) increases? Or does it decrease? Or is there no relationship at all?
1. Visualizing the Relationship: The Scatter Plot
The first and most important step in analyzing two variables is to visualize them. Our best tool for this is the scatter plot (also called a scatter diagram).
A scatter plot is a simple graph: 1. We place one variable on the horizontal axis (x-axis), often called the explanatory variable (e.g., Study Hours). 2. We place the other variable on the vertical axis (y-axis), often called the response variable (e.g., Exam Score). 3. Each student in our data provides a pair of values \((x, y)\). We plot this pair as a single point on the graph.
If we have 10 students, we will have 10 points on our graph.
2. Interpreting a Scatter Plot
When we look at the "cloud" of points on the scatter plot, we look for three things:
-
Direction (Positive or Negative):
- Positive Association: The points trend upwards from left to right. As \(X\) increases, \(Y\) tends to increase. (e.g., "Study Hours" and "Exam Score").
- Negative Association: The points trend downwards from left to right. As \(X\) increases, \(Y\) tends to decrease. (e.g., "Hours Watching TV" and "Exam Score").
- No Association: The points form a random cloud with no clear direction. The variables seem unrelated.
-
Form (Linear or Non-linear): Do the points look like they follow a straight line (linear), or do they follow a curve (non-linear)? For this introduction, we will focus on linear relationships.
-
Strength (Strong or Weak): How closely do the points follow the pattern? If the points are tightly clustered around a line, the relationship is strong. If they are very spread out, the relationship is weak.
3. Measuring the Direction: Covariance
A scatter plot gives us a visual idea of the relationship. But we also want a number to describe it.
The covariance is a number that measures the direction of the linear relationship between two variables.
How does it work? 1. First, we find the mean of \(X\) (let's call it \(\bar{x}\)) and the mean of \(Y\) (let's call it \(\bar{y}\)). 2. We can draw a vertical line at \(\bar{x}\) and a horizontal line at \(\bar{y}\) on our scatter plot. This divides the graph into four sections (quadrants). 3. For each point \((x, y)\), we calculate its distance from the mean: \((x - \bar{x})\) and \((y - \bar{y})\).
Now, think about the product of these two distances: \((x - \bar{x})(y - \bar{y})\).
- Top-Right Quadrant: \(x\) is above its mean (positive) and \(y\) is above its mean (positive). The product \((+)(+)\) is positive.
- Bottom-Left Quadrant: \(x\) is below its mean (negative) and \(y\) is below its mean (negative). The product \((-)(-)\) is also positive.
- Top-Left Quadrant: \(x\) is below its mean (negative) and \(y\) is above its mean (positive). The product \((-)(+)\) is negative.
- Bottom-Right Quadrant: \(x\) is above its mean (positive) and \(y\) is below its mean (negative). The product \((+)(-)\) is also negative.
If the relationship is positive, most points will be in the Top-Right and Bottom-Left quadrants. When we add up all the products \((x - \bar{x})(y - \bar{y})\), we will get a large positive number.
If the relationship is negative, most points will be in the Top-Left and Bottom-Right quadrants. The sum of the products will be a large negative number.
The covariance is simply the average of these products. For a sample, the formula is:
\[s_{xy} = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{n - 1}\] (We divide by \(n-1\), just like we did for sample variance.)
The Limitation of Covariance
Covariance is very useful because it gives us a single number for the direction of the relationship: - If \(s_{xy}\) is positive, the association is positive. - If \(s_{xy}\) is negative, the association is negative. - If \(s_{xy}\) is near 0, there is no linear association.
However, covariance has one big problem: the value is hard to interpret.
If we calculate a covariance of +50, is that strong or weak? What if we get +5,000,000?
The value of the covariance depends entirely on the units of \(X\) and \(Y\). If we measure height in meters and weight in kilograms, we will get one covariance. If we measure height in centimeters and weight in grams, the covariance value will be much, much larger, even though the strength of the relationship is exactly the same.
Covariance tells us the direction, but it doesn't tell us the strength of the relationship in a standardized way.
To fix this, we need to standardize the covariance. This leads us to our next topic: the correlation coefficient.
まとめ
今回は、2つの変数の関係を分析する第一歩を学びました。まず散布図で点の「雲」を描き、向き(正か負か)・形(直線かどうか)・強さ(密集しているか)を目で確かめます。次に共分散という1つの数値で関係の「向き」を表しました。各点と平均の差を掛け合わせて平均すると、正なら右上がり、負なら右下がりの関係を示します。ただし共分散は単位に左右され、値の大きさから関係の「強さ」を読み取ることはできないという限界もありました。
次回は、この限界を乗り越え、関係の強さを単位に左右されない数値で表す「相関係数」を見ていきます。
日本語訳(全文)
英文を最後まで読み終えてから、答え合わせ用にお使いください。多読の原則として、まずは訳を見ずに英文だけで理解を試みることをおすすめします。
Summary
- 2つの量的変数(2変量データ)が一緒に動くかどうかを見るために、その関係を分析します。
- 散布図(Scatter Plot)は、この関係を視覚的に表すグラフです。データのペア \((x, y)\) のそれぞれが、1つの点として打たれます。
- 散布図は、関係の向き(正か負か)、形(直線的か曲線的か)、強さ(強いか弱いか)を見分ける助けになります。
- 正の関連は、一方の変数が増えると、もう一方の変数も増える傾向にあること(点が右上がりになる)を意味します。
- 負の関連は、一方の変数が増えると、もう一方の変数が減る傾向にあること(点が右下がりになる)を意味します。
- 共分散(Covariance)は、2つの変数のあいだの線形な関係の向きを示す数値的な指標です。
- 正の共分散は正の関連を示します。負の共分散は負の関連を示します。0に近い共分散は、線形な関係がないことを示唆します。
1つの変数から2つの変数へ
ここまで私たちは、1変量データ(1つの変数)に焦点を当ててきました。その中心(平均値、中央値)と散らばり(分散、標準偏差)を表す方法を学びました。
今度は、2変量データ(2つの変数)に進みます。私たちの主な問いはこうです。この2つの変数は一緒に動くのか?
たとえば、10人の生徒からデータを集めてみましょう。 - 変数 \(X\): 1週間あたりの勉強時間 - 変数 \(Y\): 期末試験の点数
\(X\) が増えると \(Y\) も増える傾向にあるのでしょうか。それとも減るのでしょうか。あるいは、まったく関係がないのでしょうか。
1. 関係を視覚化する: 散布図
2つの変数を分析する最初の、そして最も重要な一歩は、それらを視覚化することです。これに最適な道具が散布図(散布ダイアグラムとも呼ばれます)です。
散布図はシンプルなグラフです。 1. 一方の変数を横軸(x軸)に置きます。これはしばしば説明変数と呼ばれます(例: 勉強時間)。 2. もう一方の変数を縦軸(y軸)に置きます。これはしばしば反応変数と呼ばれます(例: 試験の点数)。 3. データの中の各生徒は、値のペア \((x, y)\) を1つ提供します。このペアを、グラフ上に1つの点として打ちます。
10人の生徒がいれば、グラフ上には10個の点ができます。
2. 散布図を読み解く
散布図上の点の「雲」を見るとき、私たちは次の3つを探します。
-
向き(正か負か):
- 正の関連: 点が左から右へ右上がりになります。\(X\) が増えると、\(Y\) も増える傾向にあります。(例:「勉強時間」と「試験の点数」)。
- 負の関連: 点が左から右へ右下がりになります。\(X\) が増えると、\(Y\) は減る傾向にあります。(例:「テレビを見る時間」と「試験の点数」)。
- 関連なし: 点が明確な向きのないランダムな雲を形づくります。変数どうしは無関係に見えます。
-
形(直線的か非直線的か): 点は直線に沿っているように見えますか(線形)、それとも曲線に沿っていますか(非線形)。この入門では、線形な関係に焦点を当てます。
-
強さ(強いか弱いか): 点はそのパターンにどれだけ密に沿っているでしょうか。点が1本の線のまわりにぎゅっと集まっていれば、関係は強いといえます。点が大きく散らばっていれば、関係は弱いといえます。
3. 向きを測る: 共分散
散布図は、関係について視覚的な手がかりを与えてくれます。しかし私たちは、それを表す数値も欲しいのです。
共分散は、2つの変数のあいだの線形な関係の向きを測る数値です。
どのように働くのでしょうか。 1. まず、\(X\) の平均(\(\bar{x}\) と呼びましょう)と \(Y\) の平均(\(\bar{y}\) と呼びましょう)を求めます。 2. 散布図上で、\(\bar{x}\) のところに縦線を、\(\bar{y}\) のところに横線を引くことができます。これによりグラフは4つの区画(象限)に分かれます。 3. 各点 \((x, y)\) について、平均からの距離を計算します。\((x - \bar{x})\) と \((y - \bar{y})\) です。
さて、この2つの距離の積 \((x - \bar{x})(y - \bar{y})\) について考えてみましょう。
- 右上の象限: \(x\) はその平均より上(正)で、\(y\) もその平均より上(正)です。積 \((+)(+)\) は正です。
- 左下の象限: \(x\) はその平均より下(負)で、\(y\) もその平均より下(負)です。積 \((-)(-)\) もまた正です。
- 左上の象限: \(x\) はその平均より下(負)で、\(y\) はその平均より上(正)です。積 \((-)(+)\) は負です。
- 右下の象限: \(x\) はその平均より上(正)で、\(y\) はその平均より下(負)です。積 \((+)(-)\) もまた負です。
関係が正であれば、ほとんどの点は右上と左下の象限に入ります。すべての積 \((x - \bar{x})(y - \bar{y})\) を足し合わせると、大きな正の数になります。
関係が負であれば、ほとんどの点は左上と右下の象限に入ります。積の合計は大きな負の数になります。
共分散は、単にこれらの積の平均です。標本については、式は次のとおりです。
\[s_{xy} = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{n - 1}\] (標本分散のときと同じように、\(n-1\) で割ります。)
共分散の限界
共分散は、関係の向きを1つの数値で与えてくれるので、とても便利です。 - \(s_{xy}\) が正なら、関連は正です。 - \(s_{xy}\) が負なら、関連は負です。 - \(s_{xy}\) が0に近ければ、線形な関連はありません。
しかし、共分散には1つの大きな問題があります。値を解釈するのが難しいのです。
共分散を計算して+50になったとして、それは強いのでしょうか、弱いのでしょうか。+5,000,000になったらどうでしょう。
共分散の値は、\(X\) と \(Y\) の単位に完全に左右されます。身長をメートルで、体重をキログラムで測れば、ある共分散が得られます。身長をセンチメートルで、体重をグラムで測れば、関係の強さはまったく同じであっても、共分散の値ははるかに、はるかに大きくなります。
共分散は向きを教えてくれますが、関係の強さを標準化された形では教えてくれません。
これを直すには、共分散を標準化する必要があります。これが次のトピック、相関係数へとつながっていきます。