如何计算 R 中 Krippendorff 的 Alpha 的置信区间?

How to compute confidence intervall for Krippendorf's Alpha in R?

我确定这与 相关。但是我不明白那里的问题和答案。而且看起来连答案和评论都自相矛盾。

set.seed(0)
df <- data.frame(a = rep(sample(1:4),10), b = rep(sample(1:4),10))
kripp.alpha(t(df))

这是输出。

 Krippendorff's alpha

 Subjects = 40 
   Raters = 2 
    alpha = 0.342 

如何计算此处的置信区间?

你说得对,它连接到引导程序。您可以通过以下方式计算置信区间:

 library(irr)
 library(boot)

 alpha.boot <- function(d,w) {
        data <- t(d[w,])
        kripp.alpha(data)$value
 }

 b <- boot(data = df, statistic = alpha.boot, R = 1000)
 b
 plot(b)
 boot.ci(b, type = "perc")

这是输出:

 Bootstrap Statistics :
      original      bias    std. error
 t1* 0.3416667 -0.01376158   0.1058123

 BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
 Based on 1000 bootstrap replicates

 CALL : 
 boot.ci(boot.out = b, type = "perc")

 Intervals : 
 Level     Percentile     
 95%   ( 0.1116,  0.5240 )  
 Calculations and Intervals on Original Scale

还有一个来自 Zapf 等人的 R 脚本。 2016 look for Additional file 3 at the bottom of the page just before the references

或者您可以使用 github MikeGruz/kripp.boot

上可用的 kripp.boot 函数