POINT
- プールされた分散が現れる背景について.
【関連記事】
2標本問題
問題設定
独立な確率変数\begin{aligned}
\begin{cases}
\, X_{1}, X_{2},...,X_{n_{1}} \sim N(\mu_{1}, \sigma_{1}^{2}) \\
\, Y_{1}, Y_{2},...,Y_{n_{2}} \sim N(\mu_{2}, \sigma_{2}^{2})
\end{cases}
\end{aligned}
に対して,$\mu_{1} = \mu_{2}$かどうかを論じたい.\begin{cases}
\, X_{1}, X_{2},...,X_{n_{1}} \sim N(\mu_{1}, \sigma_{1}^{2}) \\
\, Y_{1}, Y_{2},...,Y_{n_{2}} \sim N(\mu_{2}, \sigma_{2}^{2})
\end{cases}
\end{aligned}
それぞれの母分散が既知の場合
$\bar{X} - \bar{Y} \sim N(\mu_{1} - \mu_{2}, \sigma_{1}^{2} / n_{1} + \sigma_{2}^{2} / n_{2})$だから\begin{aligned}
\frac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{\frac{\sigma_{1}^{2}}{n_{1}} + \frac{\sigma_{2}^{2}}{n_{2}}}}
\sim N(0, 1)
\end{aligned}
である.$\mu_{1} = \mu_{2}$が成り立つとき,$\sigma_{1}^{2}, \sigma_{2}^{2}$が既知なら\frac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{\frac{\sigma_{1}^{2}}{n_{1}} + \frac{\sigma_{2}^{2}}{n_{2}}}}
\sim N(0, 1)
\end{aligned}
\begin{aligned}
Z =
\frac{(\bar{X} - \bar{Y}) - \cancel{(\mu_{1} - \mu_{2})}}{\sqrt{\frac{\sigma_{1}^{2}}{n_{1}} + \frac{\sigma_{2}^{2}}{n_{2}}}}
\sim N(0, 1)
\end{aligned}
は計算することができ,既知の確率分布に従う.したがって,検定を行うことができる.Z =
\frac{(\bar{X} - \bar{Y}) - \cancel{(\mu_{1} - \mu_{2})}}{\sqrt{\frac{\sigma_{1}^{2}}{n_{1}} + \frac{\sigma_{2}^{2}}{n_{2}}}}
\sim N(0, 1)
\end{aligned}
母分散が未知だが等しい場合
$\sigma_{1}^{2}, \sigma_{2}^{2}$が未知の場合,(1標本の場合に$t$分布を得るのと同じ発想で)$Z$を計算できる量にするため$\sigma_{1}^{2},\sigma_{2}^{2}$をそれぞれ不偏分散$s_{1}^{2},s_{2}^{2}$で置き換えると,\begin{aligned}
\frac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{\frac{s_{1}^{2}}{n_{1}} + \frac{s_{2}^{2}}{n_{2}}}}
=\frac{\overbrace{\dfrac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{\frac{\sigma_{1}^{2}}{n_{1}} + \frac{\sigma_{2}^{2}}{n_{2}}}}}^{\mathrlap{\displaystyle \sim N(0, 1)}}}{\sqrt{\frac{s_{1}^{2}}{n_{1}} + \frac{s_{2}^{2}}{n_{2}}} \biggl/
\sqrt{\frac{\sigma_{1}^{2}}{n_{1}} + \frac{\sigma_{2}^{2}}{n_{2}}}}
\end{aligned}
となり,既知の分布($t$分布)にならない.しかし,$\sigma_{1}^{2}, \sigma_{2}^{2}$が未知でも$\sigma_{1}^{2} = \sigma_{2}^{2} = \sigma^{2}$であれば$t$分布をつくれる.\frac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{\frac{s_{1}^{2}}{n_{1}} + \frac{s_{2}^{2}}{n_{2}}}}
=\frac{\overbrace{\dfrac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{\frac{\sigma_{1}^{2}}{n_{1}} + \frac{\sigma_{2}^{2}}{n_{2}}}}}^{\mathrlap{\displaystyle \sim N(0, 1)}}}{\sqrt{\frac{s_{1}^{2}}{n_{1}} + \frac{s_{2}^{2}}{n_{2}}} \biggl/
\sqrt{\frac{\sigma_{1}^{2}}{n_{1}} + \frac{\sigma_{2}^{2}}{n_{2}}}}
\end{aligned}
$\sigma_{1}^{2} = \sigma_{2}^{2} = \sigma^{2}$のときは,$\sigma_{1}^{2},\sigma_{2}^{2}$を自由度$\textcolor{red}{n}$の同一の不偏分散$\textcolor{red}{s^{2}}$で置き換えると,
\begin{aligned}
\frac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{s^{2} \bigl(\frac{1}{n_{1}} + \frac{1}{n_{2}}\bigr)}}
& =\frac{\overbrace{\dfrac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{\sigma^{2} \bigl(\frac{1}{n_{1}} + \frac{1}{n_{2}}\bigr)}}}^{\mathrlap{\displaystyle \sim N(0, 1)}}}{\sqrt{ \underbrace{\dfrac{\textcolor{red}{n s^{2}}}{\sigma^{2}}} \biggl/ \textcolor{red}{n} }} \\
&\sim t(n) \\[-5ex]
&\qquad\qquad\quad
\sim \chi^{2}(n)
\end{aligned}
である($\sigma_{1}^{2}, \sigma_{2}^{2}$をそれぞれ$s_{1}^{2},s_{2}^{2}$に置き換えるのではない!).ここで,$\textcolor{red}{s^{2}}$(と$\textcolor{red}{n}$)は何を使うのが良いだろうか.\frac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{s^{2} \bigl(\frac{1}{n_{1}} + \frac{1}{n_{2}}\bigr)}}
& =\frac{\overbrace{\dfrac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{\sigma^{2} \bigl(\frac{1}{n_{1}} + \frac{1}{n_{2}}\bigr)}}}^{\mathrlap{\displaystyle \sim N(0, 1)}}}{\sqrt{ \underbrace{\dfrac{\textcolor{red}{n s^{2}}}{\sigma^{2}}} \biggl/ \textcolor{red}{n} }} \\
&\sim t(n) \\[-5ex]
&\qquad\qquad\quad
\sim \chi^{2}(n)
\end{aligned}
$s^{2}$として,$s_{1}^{2}$を使うのも,$s_{2}^{2}$を使うのも,一方の分布をひいきしていることになる.$X_{1}$と$X_{2}$の分散は等しいから,これらの情報を全て合わせて計算した分散(プールされた分散,合併した分散,pooled variance)
\begin{aligned}
s^{2}
&= \frac{1}{ (n_{1}-1) + (n_{2}-1) } \\
& \qquad \times \biggl[ \sum_{i=1}^{n_{1}} (X_{i} - \bar{X})^{2} + \sum_{i=1}^{n_{2}} (Y_{i} - \bar{Y})^{2} \biggr] \\
&= \frac{1}{n_{1} + n_{2} - 2} \biggl[ (n_{1}-1) s_{1}^{2} + (n_{2}-1) s_{2}^{2}\biggr]
\end{aligned}
を使えると嬉しい.つまり,これがs^{2}
&= \frac{1}{ (n_{1}-1) + (n_{2}-1) } \\
& \qquad \times \biggl[ \sum_{i=1}^{n_{1}} (X_{i} - \bar{X})^{2} + \sum_{i=1}^{n_{2}} (Y_{i} - \bar{Y})^{2} \biggr] \\
&= \frac{1}{n_{1} + n_{2} - 2} \biggl[ (n_{1}-1) s_{1}^{2} + (n_{2}-1) s_{2}^{2}\biggr]
\end{aligned}
\begin{aligned}
\frac{(n_{1} + n_{2} - 2) s^{2}}{\sigma^{2}}
&\sim \chi^{2}(n_{1} + n_{2} - 2)
\end{aligned}
となってくれれば全て丸く収まる.\frac{(n_{1} + n_{2} - 2) s^{2}}{\sigma^{2}}
&\sim \chi^{2}(n_{1} + n_{2} - 2)
\end{aligned}
そして,これは成り立つ.まず,
\begin{aligned}
\sum_{i = 1}^{n_{1}} \biggl(\frac{X_{i} - \bar{X}}{\sigma} \biggr)^{2}
&=\frac{(n_{1} - 1) s_{1}^{2}}{\sigma^{2}}
\sim \chi^{2}(n_{1}-1) \\
\sum_{i = 1}^{n_{2}} \biggl(\frac{Y_{i} - \bar{Y}}{\sigma} \biggr)^{2}
&=\frac{(n_{2} - 1) s_{2}^{2}}{\sigma^{2}}
\sim \chi^{2}(n_{2}-1)
\end{aligned}
である.さらに,カイ二乗分布は再生性をもつ(i.e. $X_{i}\sim \chi^{2}(n_{i})\,(i=1,2) \Rightarrow X_{1} + X_{2} \sim \chi^{2}(n_{1} + n_{2})$)から,\sum_{i = 1}^{n_{1}} \biggl(\frac{X_{i} - \bar{X}}{\sigma} \biggr)^{2}
&=\frac{(n_{1} - 1) s_{1}^{2}}{\sigma^{2}}
\sim \chi^{2}(n_{1}-1) \\
\sum_{i = 1}^{n_{2}} \biggl(\frac{Y_{i} - \bar{Y}}{\sigma} \biggr)^{2}
&=\frac{(n_{2} - 1) s_{2}^{2}}{\sigma^{2}}
\sim \chi^{2}(n_{2}-1)
\end{aligned}
\begin{aligned}
\frac{(n_{1} + n_{2} - 2) s^{2}}{\sigma^{2}}
& = \frac{(n_{1} - 1) s_{1}^{2}}{\sigma^{2}} + \frac{(n_{2} - 1) s_{2}^{2}}{\sigma^{2}} \\
&\sim \chi^{2}(n_{1} + n_{2} - 2)
\end{aligned}
となり,示された.\frac{(n_{1} + n_{2} - 2) s^{2}}{\sigma^{2}}
& = \frac{(n_{1} - 1) s_{1}^{2}}{\sigma^{2}} + \frac{(n_{2} - 1) s_{2}^{2}}{\sigma^{2}} \\
&\sim \chi^{2}(n_{1} + n_{2} - 2)
\end{aligned}
以上より,
\begin{aligned}
&\frac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{s^{2} \bigl(\frac{1}{n_{1}} + \frac{1}{n_{2}}\bigr)}} \\
& =\frac{\overbrace{\dfrac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{\sigma^{2} \bigl(\frac{1}{n_{1}} + \frac{1}{n_{2}}\bigr)}}}^{\mathrlap{\displaystyle \sim N(0, 1)}}}{\sqrt{ \underbrace{\dfrac{(n_{1} + n_{2} - 2) s^{2}}{\sigma^{2}}} \biggl/ (n_{1} + n_{2} - 2) }} \\
& \\
&\sim t(n_{1} + n_{2} - 2) \\[-8ex]
&\qquad\qquad\quad
\sim \chi^{2}(n_{1} + n_{2} - 2)
\end{aligned}
は計算することができ,既知の確率分布に従う.したがって,検定を行うことができる.&\frac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{s^{2} \bigl(\frac{1}{n_{1}} + \frac{1}{n_{2}}\bigr)}} \\
& =\frac{\overbrace{\dfrac{(\bar{X} - \bar{Y}) - (\mu_{1} - \mu_{2})}{\sqrt{\sigma^{2} \bigl(\frac{1}{n_{1}} + \frac{1}{n_{2}}\bigr)}}}^{\mathrlap{\displaystyle \sim N(0, 1)}}}{\sqrt{ \underbrace{\dfrac{(n_{1} + n_{2} - 2) s^{2}}{\sigma^{2}}} \biggl/ (n_{1} + n_{2} - 2) }} \\
& \\
&\sim t(n_{1} + n_{2} - 2) \\[-8ex]
&\qquad\qquad\quad
\sim \chi^{2}(n_{1} + n_{2} - 2)
\end{aligned}
参考文献
- [1] 入門統計解析 (倉田博史・星野崇宏):6.4 2標本問題
- [2] 統計学入門 (東京大学教養学部統計学教室):10.5 2標本問題