用語 : 分散分析/ Terminology : ANOVA

Published:

Table of contents

Contents.

1. 分散分析 / Analysis of variance (ANOVA)

  • 多群に対し多重比較する際は、まず一元配置分散分析を行い、有意性があれば多重比較を行う。2群の検定法を何度も繰り返してはいけない。
  • $ F = t^2 $

1.1. 分散分析表 / Analysis of variance table (ANOVA table)

因子
S
平方和
SS
自由度
DF
平方和平均
MS
F値
F
群(Factor)or
群間(Between samples)
$SS_F$$DF_F = \mbox{群数} - 1$$MS_F = \frac{S_F}{DF_F}$$F = \frac{MS_F}{MS_E}$
残差(Error)or
郡内(Within samples)
$SS_E$$DF_E = \mbox{全データ数} - \mbox{群数}$$MS_E = \frac{S_E}{DF_E}$ 
全体(Total)$SS_T = SS_F + SS_E$   
S : The source of the variation in the data. 
SS : The sum of squares due to the source.
DF : The degrees of freedom in the source.
MS : The mean sum of squares due to the source.
F : The F-statistic.
P : The P-value.

2. 一元配置分散分析 / One-way [One-factor] analysis of variance

  • 検定の為の仮説は
    • $ H_0 : \mu_1 = \mu_2…= \mu_i$
    • $ H_1 : \mbox{not all of the } \mu_i \mbox{ are equal}$
  • つまり対象となった群(の中の標本)の平均に違いがあるということしか分からない。

2.1. 分散分析表

因子
S
平方和
SS
自由度
DF
平方和平均
MS
F値
F
群(Factor)or
群間(Between samples)
$SS_F$$DF_F = \mbox{群数} - 1$$U_F = \frac{S_F}{DF_F}$$F = \frac{MS_F}{MS_E}$
残差(Error)or
郡内(Within samples)
$SS_E$$DF_E = \mbox{全データ数} - \mbox{群数}$$U_E = \frac{S_E}{DF_E}$ 
全体(Total)$SS_T = SS_F + SS_E$   

2.2. 分散分析表作成手順

2.2.1. 前提

肥料別収穫高。以下のデータが得られとする。

肥料A肥料B肥料C
6.98.38.0
5.46.810.5
5.87.88.1
4.69.26.9
4.06.59.3

2.2.2. 群間の平方和を求める

全体の平均

 肥料A,B,C
平均$ 7.20667 \fallingdotseq 7.21 $

肥料毎に平均を求める

 肥料A肥料B肥料C
平均5.347.728.56

それぞれの群の平方和

 肥料A肥料B肥料C
SS$ \left(5.34 - 7.21\right)^2 * 5 = 17.42$$ \left(7.72 - 7.21\right)^2 * 5 = 1.32$$ \left(8.56 - 7.21\right)^2 * 5 = 9.16$

合計:27.897 = SS(肥)

2.2.3. 残差の平方和を求める

全体の平方和を求める

肥料A肥料B肥料C
$ \left(6.9 - 7.21\right)^2 \times 1 = 0.09$1.200.63
3.260.1710.85
1.980.350.80
6.793.970.09
10.280.504.38

合計:45.349 = SS(全体)

\begin{aligned} \mbox{SS(残差)} &= \mbox{SS(全体)} - \mbox{SS(肥料)} \\
&= 45.359 - 27.897 \\
&= 17.452 \end{aligned}

2.2.4. 自由度を計算する

\begin{aligned} & DF\mbox(肥料) = \mbox{3列} - 1 = 2 \\
& DF\mbox{(残差)} = DF\mbox{(全)} - DF\mbox{(肥)} = 14 - 2 = 12 \\
& DF\mbox(全体) = \mbox{全要素数} - 1 = 15 - 1 = 14 \end{aligned}

2.2.5. 分散分析表を完成

SSSDFMSF
肥料27.897213.949$ \frac{MS\mbox{(肥)}}{MS\mbox{(残)}}$ = 9.59
残差17.452121.454-
全体45.24914--

3. 二元配置分散分析 / Two-way analysis of variance

3.1. 分散分析表

SSSDFMSF
Factor A$SS_A$$DF_A = r - 1$$MS_A = \frac{SS_A}{DF_A}$$F_A = \frac{MS_A}{MS_E}$
Factor B$SS_B$$DF_B = c - 1$$MS_B = \frac{SS_B}{DF_B}$$F_B = \frac{MS_B}{MS_E}$
Interaction$SS_{AB}$$DF_{AB} = \left( r-1 \right) \left(c - 1 \right)$$MS_{AB} = \frac{SS_{AB}}{DF_{AB}}$$F_{AB} = \frac{MS_{AB}}{MS_E}$
Error(Within)$SS_E$$DF_E = rc \left( n - 1 \right)$$SS_E = \frac{SS_E}{DF_E}$ 
Total$SS_T = SS_F + SS_E$$DF_T = rcn-1$  

3.2. 分散分析表作成手順

3.2.1. 前提

肥料別、土壌別収穫高。以下のデータが得られとする。

土壌肥料A肥料B肥料C
赤土4.13.13.5
3.92.83.2
4.33.33.6
黒土2.71.92.7
3.12.22.3
2.62.32.5

3.2.2. 群間の平方和を求める

全体の平均

土壌肥料A,B,C
赤,黒土$ 3.005555556 \fallingdotseq 3.006 $

土壌毎に平均を求める

土壌肥料A,B,C
赤土$ 3.533333333 \fallingdotseq 3.533 $
黒土$ 2.477777778 \fallingdotseq 2.478 $

土壌の平方和

土壌肥料A,B,C
赤土$ \left( 3.533 - 3.006 \right)^2 \times 9 = 2.507 $
黒土$ \left( 2.478 - 3.006 \right)^2 \times 9 = 2.507 $

合計:5.014 = SS(土壌)

肥料毎に平均を求める

土壌肥料A肥料B肥料C
赤,黒土3.452.62.967

肥料の平方和

土壌肥料A肥料B肥料CSS(肥料)
赤,黒土$ \left(3.45 - 3.006 \right)^2 \times 6 = 1.185 $$ \left(2.6 - 3.006 \right)^2 \times 6 = 0.986 $$ \left(2.967 - 3.006 \right)^2 \times 6 = 0.009 $$ 2.181 $

3.2.3. 交互作用の平方和を求める

それぞれのブロックの平均を求める

土壌肥料A肥料B肥料C
赤土4.13.0673.433
黒土2.82.1332.5

それぞれのブロックの平方和を求める

土壌肥料A肥料B肥料C
赤土$ \left(4.1 - 3.006\right)^2 \times 3 = 3.593$$ \left(3.067 - 3.006\right)^2 \times 3 = 0.011$$ \left(3.433 - 3.006\right)^2 \times 3 = 0.549$
黒土$ \left(2.8 - 3.006\right)^2 \times 3 = 0.127 $$ \left(2.133 - 3.006\right)^2 \times 3 =2.282 $$ \left(2.5 - 3.006\right)^2 \times 3 = 0.767 $

合計:7.329 よって

\begin{aligned} \mbox{SS(土壌、肥料)} &= 7.329 - \mbox{SS(土壌)} - \mbox{SS(肥料)} \\
&= 7.329 - 5.013 - 2.181 \\
&= 0.134 \end{aligned}

3.2.4. 残差の平方和を求める

全体の平方和を求める

土壌肥料A肥料B肥料C
赤土$ \left(4.1 - 3.006\right)^2 \times 1 = 1.198 $0.00890.2445
0.80000.04230.0378
1.67560.08670.3534
黒土0.09341.22230.0934
0.00890.64890.4978
0.16450.49780.2556

合計:7.929 よって

\begin{aligned} \mbox{SS(残差)} &= \mbox{SS(全体)} - \mbox{SS(肥料、土壌)} - \mbox{SS(土壌)} - \mbox{SS(肥料)} \\
&= 7.929 - 0.134 - 5.013 - 2.181 \\
&= 0.6 \end{aligned}

3.2.5. 自由度を計算

\begin{aligned} & DF\mbox(土壌) = \mbox{2行} - 1 = 1 \\
& DF\mbox(肥料) = \mbox{3行} - 1 = 2 \\
& DF\mbox(交互) = \left( \mbox{2行} \right) \left( \mbox{3行} - 1 \right) = 2 \\
& DF\mbox{(残差)} = DF\mbox{(全)} - DF\mbox{(土)} - DF\mbox{(肥)} - DF\mbox{(交)} = 17 - 1 - 2 - 2 = 12 \\
& DF\mbox(全体) = \mbox{全要素数} - 1 = 18 - 1 = 17 \end{aligned}

3.2.6. 分散分析表を完成

SSSDFMSFP
土壌5.01315.013$ \frac{MS\mbox{(土)}}{MS\mbox{(残)}}$ = 100.280
肥料2.18121.091$ \frac{MS\mbox{(肥)}}{MS\mbox{(残)}}$ = 21.810.0001
交互作用0.13420.672$ \frac{MS\mbox{(交)}}{MS\mbox{(残)}}$ = 1.340.298
残差0.6120.050--
全体7.92917---
p値の計算方法