I have a dataset that looks like the following but with much more rows and groups:
df2 <- data.frame(
"group" = c(1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5),
"R1" = c(1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0),
"R2" = c(1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0),
"R3" = c(1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0))
where R1, R2, and R3 are different raters. I want to calculate the inter-rater reliability (inter-coder reliability) within each group. How could I loop over the groups to do that?
I found a similar questions here: Inter-rater reliability per category but there is no answer. I appreciate any help even it is only about the looping over the groups without the calculation of the inter-rater reliability.