Diff for "FAQ/BPkapCIR" - CBU statistics Wiki
location: Diff for "FAQ/BPkapCIR"
Differences between revisions 3 and 4
Revision 3 as of 2012-08-08 10:55:25
Size: 1036
Editor: PeterWatson
Comment:
Revision 4 as of 2012-08-08 10:56:12
Size: 1050
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
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. The complete case 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 intervals for Brennan and Prediger (1981) kappa

The complete case 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)