I have a data frame with data from two raters to test the reliability of 4 different tests:
test1_rater1<-c(1,4,3,2,3,4,1,2,2,3)
test2_rater1<-c(1,3,3,3,2,3,1,1,2,1)
test3_rater1<-c(1,4,3,4,4,2,3,1,3,4)
test4_rater1<-c(1,3,4,2,3,2,1,2,3,2)
test1_rater2<-c(1,3,3,4,3,4,3,2,1,3)
test2_rater2<-c(1,3,1,3,1,3,3,1,1,1)
test3_rater2<-c(1,3,3,2,4,2,3,4,3,4)
test4_rater2<-c(2,3,4,4,3,2,3,2,3,2)
mydata<-data.frame(test1_rater1,test2_rater1,test3_rater1,test4_rater1,test1_rater2,test2_rater2,test3_rater2,test4_rater2)
# For the kappa statistic, I used:
cohen.kappa(cbind(test1_rater1,test1_rater2))
cohen.kappa(cbind(test2_rater1,test2_rater2))
cohen.kappa(cbind(test3_rater1,test3_rater2))
cohen.kappa(cbind(test4_rater1,test4_rater2))
As in my data frame is data from over 80 different tests, this solution is quiet complicated... I thougt about a list and then using the lapply function, but i did not work. Is there e shorter way to do this?
Thanks, Nat