I am working on some inter-coder reliability analyses for my dissertation meta-analysis. Myself ("TM") and another coder ("AY") coded data from a couple hundred study documents. I want to be able to create a function that allows me to enter in the study-document ID as an argument and then have the function output tell me whether or not there was a discrepancy in the coding decisions ("Funding," "Data") between myself and the other coder. I want to do something like the following, but I can't get the function to work.
Any help?
df <- tibble(
ID = c( rep(1, 4), rep(2, 4)),
Coder1 = c( rep( paste("TM"), 8)),
Coder2 = c( rep( paste("AY"), 8)),
Funding1 = rep(1, 8),
Funding2 = c( rep(1, 4), rep(0, 4)),
Data1 = c( rep(1, 4), rep(0, 4)),
Data2 = rep(1, 8)
)
ndf <- df %>%
filter(ID == 1) #> I want to be able to enter the study ID (the document number)
unique( ndf$Funding1 == ndf$Funding2) #> And then have the function output whether or not
unique( ndf$Data1 == ndf$Data2) #> we agreed/disagreed on a coding decision
Created on 2019-05-21 by the reprex package (v0.2.1)
Do you want the function to say whether the two coders agreed every time on ID == 1, or they agreed n out of m times, or something else?
I want the output to say, for ID == 1, is Funding1 == Funding2 and Data1 == Data2? The output could be for each individual row or for each set of rows (unique).
For example, Coder1 said ID == 2 did receive funding for their study, but Coder2 said ID == 2 did not receive funding. I want the output to point out where we disagreed on a coding decision. Does that make sense? The decision could be for each row/case or for the set of Funding/Data decisions for each coder.
WONDERFUL! Thanks so much for your help! This is exactly the type of function I was looking to write. Thanks a million. You just saved me days of beating my head against the wall.
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: