6436. Re: 2群の比較なのにANOVAを用いるのはなぜでしょうか? 青木繁伸  2005/04/12 (火) 21:11 
>
条件が2つ,変数が1つのデータをANOVAやKruskal-Wallisテストで処理をしている論文をよく見かけるのですが,なぜPared or
Unpared TもしくはノンパラのTで処理をしないのでしょうか?そっちの方が有意差が出やすいのでしょうか? 
 
正確に記述しましょう。 
t 検定という場合の,t は,T ではありません。 
ノンパラのTというのは,もっと訳が分かりません(マン・ホイットニーのU検定でしょうが)。 
 
発言をまとめると, 
「二群の平均値の差の検定でt検定ではなくて一元配置分散分析(F検定)を行うのはなぜか」 
「二群の代表値の差の検定でマン・ホイットニーのU検定ではなくてやKruskal-Wallis検定を行うのはなぜか」 
ということでしょうか? 
解答:同じだから,どちらを使ってもかまいません。 
> x <- c(2, 4, 5, 3, 8) # 5個の測定値 
> y <- c(3, 5, 9,10,12)# 5個の測定値 
 
> t.test(x, y, var.equal=TRUE) # 等分散を仮定する t 検定 
 
    Two Sample t-test 
 
data:  x and y  
t = -1.7442, df = 8, p-value = 0.1193 # 有意確率【あ】 
alternative hypothesis: true difference in means is not equal to 0  
95 percent confidence interval: 
 -7.895230  1.095230  
sample estimates: 
mean of x mean of y  
      4.4       7.8  
 
> oneway.test(c(x,y) ~ as.factor(rep(1:2, c(5, 5))), var.equal=TRUE) 
 
    One-way analysis of means 
 
data:  c(x, y) and as.factor(rep(1:2, c(5, 5)))  
F = 3.0421, num df = 1, denom df = 8, p-value = 0.1193 # 有意確率【い】 
 
> wilcox.test(x, y, exact=FALSE, correct=FALSE) 
 
    Wilcoxon rank sum test 
 
data:  x and y  
W = 5, p-value = 0.1150 # 有意確率【う】 
alternative hypothesis: true mu is not equal to 0  
 
> kruskal.test(c(x,y) ~ as.factor(rep(1:2, c(5, 5)))) 
 
    Kruskal-Wallis rank sum test 
 
data:  c(x, y) by as.factor(rep(1:2, c(5, 5)))  
Kruskal-Wallis chi-squared = 2.4847, df = 1, 
p-value = 0.1150 # 有意確率【え】 
 
【あ】と【い】,【う】と【え】が同じになる。 
等分散を仮定しないときのt検定は,等分散を仮定しないときの一元配置分散分析の結果に等しくなる。両方で,var.equal=FALSE とすればよい。 
wilcox.test 関数は,マン・ホイットニーのU検定を行う。exaxt=FALSE, correct=FALSE は基本的な結果を出すため。 
 |