一致性相關係數(concordance correlation coefficient; CCC)

套路39: 一致性相關係數(concordance correlation coefficient; CCC)

1. 使用時機: 一致性相關係數是一個統計量(statistic),針對連續型資料,用來估計兩種判讀方法或儀器的一致性的指標。
2. 分析類型: 母數分析(parametric analysis)直接使用資料數值算統計叫parametric方法,把資料排序之後用排序的名次算統計叫non-parametric方法。
3. 範例資料: 咪路評估兩台分析儀的一致性,讀值資料如下:
組別
1
2
3
4
5
6
7
8
9
10
11
分析儀1
0.22
0.26
0.30
0.33
0.36
0.39
0.41
0.44
0.47
0.51
0.55
分析儀2
0.21
0.23
0.27
0.27
0.31
0.33
0.37
0.38
0.40
0.43
0.47
4. 使用R計算組內相關係數方法一:
第一步: 安裝DescTools程式套件
第二步: 呼叫DescTools程式套件備用
  library(DescTools)
第三步: 輸入建立資料
  Sp1 <- c(0.22, 0.26, 0.30, 0.33, 0.36, 0.39, 0.41, 0.44, 0.47, 0.51, 0.55)
  Sp2 <- c(0.21, 0.23, 0.27, 0.27, 0.31, 0.33, 0.37, 0.38, 0.40, 0.43, 0.47)
第四步: 閱讀DescTools程式套件中CCC函數的使用說明
  help(CCC)
第五步: 使用DescTools程式套件的CCC函數代入Sp1Sp2計算組內相關係數及p
  CCC(Sp1, Sp2, ci = "z-transform", conf.level = 0.95)
第六步: 判讀計算結果
  $rho.c
        est    lwr.ci    upr.ci
1 0.8337058 0.6470369 0.9260831
  # 一致性相關係數rc = 0.8337058
  # 沒有提供p值。
  # ci: 信賴區間(confidence interval)
5. 使用R計算組內相關係數方法二:
第一步: 安裝epiR程式套件
第二步: 呼叫epiR程式套件備用
  library(epiR)
第三步: 輸入建立資料
  Sp1 <- c(0.22, 0.26, 0.30, 0.33, 0.36, 0.39, 0.41, 0.44, 0.47, 0.51, 0.55)
  Sp2 <- c(0.21, 0.23, 0.27, 0.27, 0.31, 0.33, 0.37, 0.38, 0.40, 0.43, 0.47)
第四步: 閱讀epiR程式套件中epi.ccc函數的使用說明
  help(epi.ccc)
第五步: 使用epiR程式套件中epi.ccc函數代入Sp1Sp2計算組內相關係數及p
  epi.ccc(Sp1, Sp2, ci = "z-transform", conf.level = 0.95, rep.measure = FALSE)
第六步: 判讀計算結果
  $rho.c
        est     lower     upper
1 0.8337058 0.6470369 0.9260831
$s.shift
[1] 0.809665
$l.shift
[1] -0.5826083
$C.b
[1] 0.8388642
# 一致性相關係數rc = 0.8337058
# 沒有提供p值。
6. 使用R計算組內相關係數方法三:
第一步: 安裝cccrm程式套件
第二步: 呼叫cccrm程式套件備用
  library(cccrm)
第三步: 輸入建立資料
dat <- read.table(header = T, text = "
Va ID Sp
0.22 1 1
0.26 2 1
0.3 3 1
0.33 4 1
0.36 5 1
0.39 6 1
0.41 7 1
0.44 8 1
0.47 9 1
0.51 10 1
0.55 11 1
0.21 1 2
0.23 2 2
0.27 3 2
0.27 4 2
0.31 5 2
0.33 6 2
0.37 7 2
0.38 8 2
0.40 9 2
0.43 10 2
0.47 11 2")
  # ID: 樣本編號,Sp: 儀器編號,Va: 儀器讀值
第四步: 閱讀cccrm程式套件的cccvc函數的使用說明
  help(cccvc)
第五步: 使用cccrm程式套件的cccvc函數代入dat資料計算結果儲存到變數estccc
  estccc <- cccvc(dat,"Va","ID","Sp")
  # 變數名稱estccc為使用者自定
第六步: 判讀計算結果
estccc
  CCC estimated by variance components:
  CCC  LL CI 95%  UL CI 95%   SE CCC
0.84650264 0.65565247 0.93568549 0.06630915
  # 一致性相關係數rc = 0.84650264
  # 沒有提供p值。
第七步: 使用基本模組(base)summary函數顯示回歸數據
  summary(estccc)
Linear mixed-effects model fit by REML
 Data: dades
        AIC       BIC   logLik
  -53.89028 -49.90735 30.94514
Random effects:
 Formula: ~1 | ind
        (Intercept)  Residual
StdDev:  0.09299551 0.0157538
Fixed effects: list(form)
                 Value   Std.Error DF   t-value p-value
(Intercept)  0.3854545 0.028438685 10 13.553881       0
met2        -0.0518182 0.006717444 10 -7.713973       0
 Correlation:
          (Intr)
met2 -0.118
Standardized Within-Group Residuals:
   Min        Q1        Med        Q3         Max
-1.45703306 -0.46891698 -0.02204018  0.54282347  1.19744868
Number of Observations: 22
Number of Groups: 11
CCC estimated by variance compoments
  CCC  LL CI 95%  UL CI 95%   SE CCC
0.84650264 0.65565247 0.93568549 0.06630915

來勁了嗎? 想知道更多?? 補充資料(連結):
1. 關於correlation coefficient (https://en.wikipedia.org/wiki/Correlation_coefficient)
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)

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

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