Student のt 検定

Student の t 検定は、2群の平均の差を比較する際によく用いられる。なお、Student の t 検定には条件が二つある。

条件1:正規分布に従う。

条件2:2群の分散が等しい。

条件1に当てはまらない場合、Mann-Whitney の U 検定などが用いられる。

条件2に当てはまらない場合、Welch の t 検定が用いられる。

なお、サンプルサイズが小さい場合、条件1、2がよくわからないことがある。各群のNがそれぞれ2〜5の場合は、効果量が大きい場合に限って Student の t 検定が使える。

De Winter JC. (2013). Using the Student's t-test with extremely small sample sizes. Practical Assessment, Research & Evaluation, 18(10).

以上の検定は、基本的に対応のない検定である。ランダム化対照試験のように、同一人物の前後を比較する場合は、「対応のある t 検定」を行う。対応のある t 検定は、前後データそのものではなく、その差のデータを検定する。正規分布に従うかどうかも、データそのものではなくデータの差を調べる。

R でのサンプル

> group_A <- c(0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.65, 1.68)
> t.test(group_A, group_A)

	Welch Two Sample t-test

data:  group_A and group_A
t = 0, df = 18, p-value = 1
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.2612832  0.2612832
sample estimates:
mean of x mean of y 
   1.333     1.333 

上の例では、同じデータを検定しているため、当然ながら有意差がない。t =0 であり、自由度は18、p値は1となっている。

> group_B <- c(0.75, 0.78, 0.80, 0.85, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4)
> t.test(group_A, group_B)

	Welch Two Sample t-test

data:  group_A and group_B
t = 2.8398, df = 17.43, p-value = 0.01112
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
0.08399664 0.56600336
sample estimates:
mean of x mean of y 
   1.333     1.008 

B群を追加した。A群とB群の t 検定は、Welch の t 検定が当てはめられ、T値は2.8398、p値は0.01112となった。

この記事が気に入ったらサポートをしてみませんか?