組內相關係數 (Intraclass correlation coefficient; ICC)

套路38: 組內相關係數 (Intraclass correlation coefficient; ICC)

1. 使用時機: 組內相關係數是一個統計量(statistic),用來描述同一組中的單位相互之間的相似程度。
2. 分析類型: 母數分析(parametric analysis)直接使用資料數值算統計叫parametric方法,把資料排序之後用排序的名次算統計叫non-parametric方法。
3. 範例資料: 某研究測量七組雙胞胎體重(kg)資料如下:
組別
1
2
3
4
5
6
7
雙胞胎1
70.4
68.2
77.3
61.2
72.3
74.1
71.1
雙胞胎2
71.3
67.4
75.2
66.7
74.2
72.9
69.5
4. 使用R計算組內相關係數:
第一步: 安裝irr程式套件
第二步: 呼叫irr程式套件備用
  library(irr)
第三步: 輸入建立資料
  twin1 <- c(70.4, 68.2, 77.3, 61.2, 72.3, 74.1, 71.1)
  twin2 <- c(71.3, 67.4, 75.2, 66.7, 74.2, 72.9, 69.5)
  m <- matrix(rbind(twin1, twin2), nrow = 7, byrow = TRUE)
  # 利用rbind函數合併twin1twin2兩組vector,再利用matrix函數將資料轉成7 x 2的矩陣放到變數m中。結果如下:
      [,1] [,2]
[1,] 70.4 71.3
[2,] 68.2 67.4
[3,] 77.3 75.2
[4,] 61.2 66.7
[5,] 72.3 74.2
[6,] 74.1 72.9
[7,] 71.1 69.5
第四步: 使用irr套件的icc函數代入m計算組內相關係數及p
  icc(m, model = "oneway", type = "consistency", unit = "single", r0 = 0, conf.level = 0.95)
  # model = "oneway"本例資料利用oneway的方法
第五步: 判讀計算結果
    Single Score Intraclass Correlation
     Model: oneway
     Type : consistency
     Subjects = 7
       Raters = 2
       ICC(1) = 0.827  # 組內相關係數rI = 0.827
F-Test, H0: r0 = 0 ; H1: r0 > 0
       F(6,7) = 10.6 , p = 0.00325
 95%-Confidence Interval for ICC Population Values:
    0.348 < ICC < 0.967
  # 如計算結果p < 0.05,虛無假設(H0: ρI = 0)不成立,兩組資料有組內相關
  # 如計算結果p > 0.05,虛無假設(H0: ρI = 0)成立,兩組資料無組內相關

來勁了嗎? 想知道更多?? 補充資料(連結):
1. 關於correlation coefficient (https://en.wikipedia.org/wiki/Correlation_coefficient)
2. 組內相關係數計算公式 (https://en.wikipedia.org/wiki/Intraclass_correlation)
3. 關於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
4. Zar, JH. 2010. Biostatistical Analysis, Fifth Edition, Pearson.

留言

這個網誌中的熱門文章

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

如何選擇統計方法 1

如何檢查資料是否接近常態分布 (Normality Test using R)