I am trying to use a R package called "agrmt" and use "consensus" function to calculate consensus between each collector.
My dataset is a survey data. The first column is collector ID and the other columns are different questions. The answer for survey question is from 1 to 5. I want to get " consensus score" for each question for each distinct collector ID.
If I use this "consensus" function, and use consensus(table(test_qes[, x]))
This statement basically first get the frequency for each 1 to 5 then calculate consensus score. But this is only for a question not for each distinct collector.
I use the below R code and it gave me lots of warnings and it's not correct.
for (i in 1:a) {
consensus_1 <- test_qes %>%
group_by(Collector.ID) %>%
summarise_each(funs(consensus(table(test_qes[, i + 1]))))
}
I may have to use function or double loop ? Can anybody who can help me correct this code or give me some hints?I appreciate for any constructive suggestions! Thank you !!!