3 May 19:58
Gwet's AC1 Interrater reliability
R friends, with some help of a friend and the original author I turn available this function which is helping me in some analysis. Perhaps it may be useful to others...(Continue reading)1. Gwet KL. Computing inter-rater reliability and its variance in the presence of high agreement. Br J Math Stat Psychol. 2008 ;61(Pt 1):2948. # AC1 statistic for 2 raters special case # table = k x k table which represents table(rater1,rater2), must have equal number of rows and columns # N = population size which will be stick in standard error correction, N=Inf is no correction. # conflev = Confidence Level associated with the confidence interval (0.95 is the default value) AC1 <- function(table,conflev=0.95,N=Inf,print=TRUE){ if(dim(table)[1] != dim(table)[2]){ stop('The table should have the same number of rows and columns!') } n <- sum(table) f <- n/N pa <- sum(diag(table))/n # formula 18 q <- ncol(table) # number of categories pkk <- diag(table)/n pak <- sapply(1:q,function(i)sum(table[i,]))/n pbk <- sapply(1:q,function(i)sum(table[,i]))/n pik <- (pak + pbk)/2
1.
Gwet KL. Computing inter-rater reliability and its variance in the presence
of high agreement. Br J Math Stat Psychol. 2008 ;61(Pt 1):2948.
# AC1 statistic for 2 raters special case
# table = k x k table which represents table(rater1,rater2), must have
equal number of rows and columns
# N = population size which will be stick in standard error correction,
N=Inf is no correction.
# conflev = Confidence Level associated with the confidence interval (0.95
is the default value)
AC1 <- function(table,conflev=0.95,N=Inf,print=TRUE){
if(dim(table)[1] != dim(table)[2]){
stop('The table should have the same number of rows and columns!')
}
n <- sum(table)
f <- n/N
pa <- sum(diag(table))/n # formula 18
q <- ncol(table) # number of categories
pkk <- diag(table)/n
pak <- sapply(1:q,function(i)sum(table[i,]))/n
pbk <- sapply(1:q,function(i)sum(table[,i]))/n
pik <- (pak + pbk)/2
RSS Feed