見matlab函數ttest的幫助,null hypothesis翻譯成零假設[見概率論與數理統計第八章筆記,第一個概念就是零假設]。
matlab幫助是這么描述的:h = ttest(x) performs a t-test of the null hypothesis that data in the vector x are a random sample from a normal distribution with mean 0 and unknown variance, against the alternative that the mean is not 0. The result of the test is returned in h. h = 1 indicates a rejection of the null hypothesis at the 5% significance level. h = 0 indicates a failure to reject the null hypothesis at the 5% significance level.
翻譯:h = ttest(x)執行t檢驗。零假設:x是均值為零的正態分布。備擇假設:均值不是零。h = 1 表示以5%顯著水平拒絕零假設。
問題:ttest(x,y)與ttest(y,x)結果一樣嗎?
肯定一樣,見matlab幫助,ttest(x,y)的零假設是:x-y是均值為零的隨機變量。ttest(y,x)的零假設是:y-x是均值為零的隨機變量。故兩者等價。
例子:
論文ML-KNN:Alazy learning approach to multi-label learning(Pattern Recognition)的Table 2的第一行0.194±0.010 0.220±0.011,怎么判定前者顯著好于后者?
ML-kNN 采用十折交叉驗證得到十個Hamming loss組成一個向量x,BOOSTEXTER采用十折交叉驗證得到十個Hamming loss組成一個向量y,ttext(x,y)=1表明具有統計顯著性差異,ttext(x,y)=0表明不具有統計顯著性差異
簡單代碼:
x = [0.1 0.15 0.13 0.24 0.26];
y = [0.2 0.21 0.58 0.06 0.04];
ttest(x,y)
ttest(y,x)
x = [0.1 0.15 0.13 0.24 0.26 0.21 0.26 0.28 0.36 0.38];%x的前五個值與原來相同
y = [0.2 0.21 0.58 0.06 0.04 0.46 0.54 0.91 0.58 0.75];%y的前五個值與原來相同,故意將y的后五個值與x的后五個值差異比較大
ttest(x,y)
ttest(y,x)