I have a dataframe that contains similar values across three columns of school, lesson, grade and teacher_id
. The column enumerator
is not unique because the data collected was observation data collected by two different people on the same school, class, lesson and grade
. Obs1
, Obs2
and Obs3
columns are scores given by the two enumerators
(pairs) based on the 3 entities (Obs1, Obs2, Obs3) being observed in the class.
school <- c('school A', 'school B', 'school C', 'school A', 'school B', 'school C', 'school B', 'School B')
lesson <- c('Maths', ' English', 'Social Studies', 'Maths', 'English', 'Social Studies', 'English','English')
grade <- c (2,3,2,2,3,2,2,2)
teacher_id <- c(23,24,22,23,24,22,27,27)
enumerator <- c('John','Steven', 'Mary', 'Joy', 'George', 'Don', 'Junior','Yves')
Obs1 <- c(0,1,2,3,0,1,2,1)
Obs2 <- c(1,2,0,0,1,1,2,0)
Obs3 <- c(0,1,0,1,1,0,2,0)
> DF2
school lesson grade teacher_id enumerator Obs1 Obs2 Obs3
1 school A Maths 2 23 John 0 1 0
2 school B English 3 24 Steven 1 2 1
3 school C Social Studies 2 22 Mary 2 0 0
4 school A Maths 2 23 Joy 3 0 1
5 school B English 3 24 George 0 1 1
6 school C Social Studies 2 22 Don 1 1 0
7 school B English 2 27 Junior 2 2 2
8 School B English 2 27 Yves 1 0 0
The end goal is to calculate inter-rater reliability of this data. R tutorials for calculating inter-reliability measures depict a different structure.
https://www.datanovia.com/en/lessons/cohens-kappa-in-r-for-two-categorical-variables/
How do I go about this given the structure of this data?