Point-biserial相關係數 (Point-biserial correlation coefficient)

套路37: Point-biserial相關係數 (Point-biserial correlation coefficient)

1. 使用時機: Point-biserial 相關係數(rpb)是兩個變量(variables)中有一個是二元變量(dichotomous variable)時的關聯性度量。
2. 分析類型: 母數分析(parametric analysis)直接使用資料數值算統計叫parametric方法,把資料排序之後用排序的名次算統計叫non-parametric方法。
3. 範例資料: 咪路研究某種藥物對兔子的凝血時間(分鐘)資料如下:
藥物
0
0
0
0
0
0
1
1
1
1
1
1
1
凝血時間
8.8
8.4
7.9
8.7
9.1
9.6
9.9
9.0
11.1
9.6
8.7
10.4
9.5
4. 使用R計算Point-biserial相關係數方法一:
第一步: 安裝ltm程式套件
第二步: 呼叫ltm程式套件備用
  library(ltm)
第三步: 輸入建立資料
  v1 <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1)
  v2 <- c(8.8, 8.4, 7.9, 8.7, 9.1, 9.6, 9.9, 9.0, 11.1, 9.6, 8.7, 10.4, 9.5)
第四步: 閱讀ltm程式套件的biserial.cor函數的使用說明
  help(biserial.cor)
第五步: 使用ltm程式套件的biserial.cor函數代入v1v2計算Point-biserial相關係數
  biserial.cor (v2, v1, use = "complete.obs")
  # biserial.cor (v1, v2, use = "complete.obs")不能執行
  # 放入函數的第二組變數必須是二元變量(dichotomous variable)
第六步: 判讀計算結果
    [1] -0.5748291
  # 沒有提供假設檢定p值。
5. 使用R計算Point-biserial相關係數方法二:
由於Point-biserial相關係數與皮爾森相關係數很近似,因此可利用計算皮爾森相關係數的方法來估計Point-biserial相關係數及其p
第一步: 輸入建立資料
  v1 <- c(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1)
  v2 <- c(8.8, 8.4, 7.9, 8.7, 9.1, 9.6, 9.9, 9.0, 11.1, 9.6, 8.7, 10.4, 9.5)
第二步: 使用基本(base)模組函數cor.test代入v1v2估計Point-biserial相關係數並進行假設檢定
  cor.test(v1, v2, alternative = "two.sided", method = "pearson")
第三步: 判讀結果
            Pearson's product-moment correlation
data:  v1 and v2
t = 2.4765, df = 11, p-value = 0.03076
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
     0.07058429 0.86434926
sample estimates:
          cor   0.5983011  #估計Point-biserial相關係數
  # 如計算結果p-value < 0.05,虛無假設(H0: ρpb = 0)不成立,藥與凝血時間有關
  # 如計算結果p-value > 0.05,虛無假設(H0: ρpb = 0)成立,藥與凝血時間無關

來勁了嗎? 想知道更多?? 補充資料(連結):
2. 關於correlation coefficient (https://en.wikipedia.org/wiki/Correlation_coefficient)
3. Point-biserial 相關係數計算公式 (https://en.wikipedia.org/wiki/Point-biserial_correlation_coefficient)
4. 關於R基礎R繪圖及統計快速入門:
   b. Cookbook for R: http://www.cookbook-r.com/
   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
5. Zar, JH. 2010. Biostatistical Analysis, Fifth Edition, Pearson.

留言

這個網誌中的熱門文章

統計不球人 目錄 (Table of Contents)

比較二或多組變異數Levene’s 檢定 (Levene’s Test for Comparing Two or More Variances)

三因子變異數分析 (Three Way ANOVA)