單一樣本符號檢定 (One Sample Sign test)
套路9: 單一樣本符號檢定 (One Sample Sign test)
什麼是單一樣本假設檢定? 說白了就是只有一組資料做假設檢定。統計假設檢定檢定什麼?看H0。例如單一樣本假設檢定H0 : median等於 0,HA : median不等於0是檢定資料的平均值是否為0。又例如單一樣本假設檢定H0 : median
小於 8,HA : median
大於等於 8是檢定資料的平均值是否小於8。假設相等時為雙尾 (two-tailed test) 檢定。假設不相等時為單尾 (one-tailed test) 檢定。如下圖所示:
1. 使用時機: 用於分析一組資料的中位數與期望值的差異。
2. 分析類型: 無母數分析(non-parametric test)。直接使用資料數值算統計叫parametric方法,把資料排序之後用排序的名次算統計叫non-parametric方法。
3. 資料範例: 咪路測量招潮蟹大螯長度,資料如下:
| 
   
招潮蟹 
 | 
  
   
1 
 | 
  
   
2 
 | 
  
   
3 
 | 
  
   
4 
 | 
  
   
5 
 | 
  
   
6 
 | 
  
   
7 
 | 
  
   
8 
 | 
  
   
9 
 | 
  
   
10 
 | 
  
   
11 
 | 
  
   
12 
 | 
  
   
13 
 | 
  
   
14 
 | 
  
   
15 
 | 
 
| 
   
大螯長度(cm) 
 | 
  
   
2.8 
 | 
  
   
2.5 
 | 
  
   
2.6 
 | 
  
   
2.4 
 | 
  
   
2.4 
 | 
  
   
2.2 
 | 
  
   
2.1 
 | 
  
   
1.9 
 | 
  
   
2.7 
 | 
  
   
1.8 
 | 
  
   
2.3 
 | 
  
   
2.5 
 | 
  
   
2.7 
 | 
  
   
2.1 
 | 
  
   
2.2 
 | 
 
H0: 招潮蟹大螯長度中位數 = 2.5。HA: 招潮蟹大螯長度中位數 ≠
2.5。
第一步: 安裝BSDA程式套件。
第二步: 呼叫BSDA程式套件備用。
  library(BSDA)
第三步: 閱讀BSDA程式套件中SIGN.test函數的說明書。
  help(SIGN.test)
第四步: 輸入建立資料。
   l <- c(2.8, 2.5,
2.6, 2.4, 2.4, 2.2, 2.1, 1.9, 2.7, 1.8, 2.3, 2.5, 2.7, 2.1, 2.2)
第五步: 使用BSDA程式套件中SIGN.test函數代入資料diff。
   SIGN.test(l, md = 2.5,
alternative = "two.sided", conf.level = 0.95)
   # md = 2.5 H0:招潮蟹大螯長度中位數 =
2.5。
   # alternative =
"two.sided"執行雙尾檢定。
第六步: 判讀結果。
        One-sample Sign-Test
data:  l
s = 4, p-value = 0.2668
alternative hypothesis: true median is not equal to 2.5
95 percent confidence interval:
 2.117817 2.582183
sample estimates:
median of x   2.4 
Achieved and Interpolated Confidence Intervals: 
                  Conf.Level
L.E.pt U.E.pt
Lower Achieved CI     0.8815
2.2000 2.5000
Interpolated CI       0.9500
2.1178 2.5822
Upper Achieved CI     0.9648
2.1000 2.6000
# p-value < 0.05,H0: 招潮蟹大螯長度中位數 =
2.5,不成立。
# p-value > 0.05,H0: 招潮蟹大螯長度中位數 =
2.5,成立。
來勁了嗎? 想知道更多?? 補充資料(連結):
5. 關於R基礎,R繪圖及統計快速入門:
   a. R Tutorial: https://www.tutorialspoint.com/r/index.htm
   b. Cookbook for R: http://www.cookbook-r.com/
   c. Quick-R: https://www.statmethods.net/
   d. Statistical tools
for high-throughput data analysis (STHDA): http://www.sthda.com/english/
e. The Handbook of Biological Statistics: http://www.biostathandbook.com/
f. An R Companion for the Handbook of
Biological Statistics: http://rcompanion.org/rcompanion/index.html
6. Zar, JH. 2010. Biostatistical Analysis, Fifth Edition,
Pearson.

留言
張貼留言