[R] Bootstrapping Krippendorff's alpha coefficient
Łukasz Ręcławowicz
lukasz.reclawowicz at gmail.com
Tue Oct 12 11:58:05 CEST 2010
Hi,
I don't know how to sample such data, it can't be done by row sampling
as default method on matrix in boot.
Function takes matrix and returns single coefficient.
#There is a macro but I want use R :)
http://www.comm.ohio-state.edu/ahayes/SPSS%20programs/kalphav2_1.SPS
library(concord)
library(boot)
# The data are rates among observers with NA's
nmm<-matrix(c(1,1,NA,1,2,2,3,2,3,3,3,3,3,3,3,3,2,2,2,2,1,2,3,4,4,4,4,4,
+ 1,1,2,1,2,2,2,2,NA,5,5,5,NA,NA,1,1,NA,NA,3,NA),nrow=4)
sample.rates<-function(matrix.data,i){
#mixed.rates<-sample individual rates and put back in new matrix (?)
return(kripp.alpha(mixed.rates)$statistic[i])
}
to.get<-boot(nmm, sample.rates, R=1e4, stype="i")
--
Miłego dnia
More information about the R-help
mailing list