10. t 検定
• (例)英語の好きな組と嫌いな組が受けたテストの
平均値に差があるかどうか
> like <- c(6,10,6,10,7,8,7,9,10,4)
> dislike <- c(3,5,6,4,4,8,4,5,4,7)
> t.test(like,dislike,var.equal=TRUE)
11. t 検定
> t.test(like,dislike,var.equal=TRUE)
Two Sample t-test
data: like and dislike
t = 3.3041, df = 18, p-value = 0.003946
alternative hypothesis: true difference in
means is not equal to 0 # 両側検定してます
95 percent confidence interval: # 信頼区間
0.9831754 4.4168246
sample estimates:
mean of x mean of y
7.7 5.0
12. t 検定の前に...
“等分散であるかどうかを確かめてから,普通の
t 検定を使うか,Welch の方法による t 検定にす
るかを決めるというのは,よくない。最初から
Welch の方法による t 検定を使えばよい。”
http://aoki2.si.gunma-u.ac.jp/lecture/Average/bunsan1.html
14. ソース! ソース!
―(等分散の検定はせず)最初から Welch で行け―
• http://oku.edu.mie-u.ac.jp/~okumura/blog/node/2262
• http://aoki2.si.gunma-u.ac.jp/lecture/BF/index.html
• Donald W. Zimmerman, ``Some properties of preliminary tests of equality of variances in
the two-sample location problem'', The Journal of General Psychology, Vol.123, pp.217-231
(1996)
• The unequal variance t-test is an underused alternative to Student's t-test and the Mann-
Whitney U test -- Ruxton 17 (4): 688 -- Behavioral Ecology
• 馬車馬のように: [統計]Mann-WhitneyのU検定と不等分散(http://qdai.way-
nifty.com/qjes/2005/02/mannwhitneyu.html
15. という訳で...
> t.test(like,dislike,var.equal=FALSE)
Welch Two Sample t-test
data: like and dislike
t = 3.3041, df = 16.795, p-value = 0.004249
alternative hypothesis: true difference in
means is not equal to 0
95 percent confidence interval:
0.9743014 4.4256986
sample estimates:
mean of x mean of y
7.7 5.0
16. ところで t 検定の t は何なのかと...
• t 分布の t なんだけど...
• ゴセットの発表した統計量(Student の t 分布)に,(論
敵の)フィッシャーが t という記号を充てた
• 別に特別な意味は無く,論文中の標本分散s^2に対する式
だったことから,s の次の t を使ったらしい...
• 「ウィリアム・ゴセット」http://ja.wikipedia.org/wiki/%E3%82%A6%E3%82%A3%E3%83%AA%E3%82%A2%E3%83%A0%E3%83%BB
%E3%82%B4%E3%82%BB%E3%83%83%E3%83%88
• 「自由度」http://ja.wikipedia.org/wiki/%E8%87%AA%E7%94%B1%E5%BA%A6
• http://mat.isc.chubu.ac.jp/fpr/fpr1997/0119.html
• http://www.pol.geophys.tohoku.ac.jp/~hanawa/ori/ori/054.html