Diff for "FAQ/BPkapCIR" - CBU statistics Wiki
location: Diff for "FAQ/BPkapCIR"
Differences between revisions 1 and 2
Revision 1 as of 2012-08-08 10:52:59
Size: 907
Editor: PeterWatson
Comment:
Revision 2 as of 2012-08-08 10:54:24
Size: 1037
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Line 4: Line 3:
The data is in this SPSS [attachment:raters.sav file] The data is in this SPSS [attachment:raters.sav file]. The directory name may need to be changed in the read.spss command argument to identify the location on your PC of your data file.

95% Bootstrap confidence itnervakls for Brennan and Prediger (1981) kappa

The data is in this SPSS [attachment:raters.sav file]. The directory name may need to be changed in the read.spss command argument to identify the location on your PC of your data file.

library(foreign)
x <- read.spss("U://My Documents//raters.sav")
x1 <- data.frame(x)
attach(x1)


# Evaluates a bootstrap 95% CI for Brennan and Prediger's (1981) kappa for random numbers of categories to rate (for two raters)
# Ratings are in  SPSS file in two columns called rater1 and rater2
#
 
#
nb<-1000
n <- length(rater1)
boot<-matrix(NA,nb,n)
boot1<-matrix(NA,nb,n)
bsum <- matrix(NA,nb,1)
kapbp <- matrix(NA,nb,1)

attributes(boot)
for (i in 1:nb) {
bs1<-sample(rater1,n,replace=T)
bs2<-sample(rater2,n,replace=T)
for (j in 1:n) {
boot[i,j] <- bs1[j]-bs2[j]
boot1[i,j] <- ifelse(boot[i,j] == 0,1,0)
}
kapbp[i] <-  ( (sum(boot1[i,])/n) - (1/n))/(1 - (1/n)) 
}

hist(kapbp)
quantile(kapbp,0.025)
quantile(kapbp,0.975)

None: FAQ/BPkapCIR (last edited 2013-03-08 10:17:28 by localhost)