I have a dataframe where each row represents the ratings a project group received from one of three raters (advisor, mentor, other). The columns titled ELA1, ELA2, MATH1, MATH2, ESS1, ESS2 are the items groups can be rated on. However, each group only needs to be rated on three of these items, which means each group can be rated on a different set items. But all three raters should rate the same items within a group. I want to check whether all three raters rated the same set of items within a group. It would be ideal to create a dummy variable that indicates whether the group received ratings on the same set of items from each rater.
Below is an example of my data frame:
df <- data.frame(group=c("A","A","A","B","B","B","C","C","C"),
rater=c("Advisor", "Mentor", "Other", "Advisor", "Mentor", "Other", "Advisor", "Mentor", "Other"),
ELA1=c(1, 2, 2, NA, NA, 1, NA, NA, NA),
ELA2=c(NA, NA, NA, 2, NA, 1, NA, NA, NA),
MATH1=c(3, 3, 2, NA, 2, NA, 3, 3, 2),
MATH2=c(2, 3, 2, NA, NA, 1, 3, 3, 1),
ESS1=c(NA, NA, NA, 2, 2, NA, 3, 3, 1),
ESS2=c(NA, NA, NA, 2, 2, NA, NA, NA, NA))
In the example data frame above, there are two groups (group A and C) that are scored on the same items by all three judges. But the ratings provided by each rater to group B were not for the same set of items. I need help figuring out how to write code that will identify instances when each rater did not rate the same set of skills within a group and ideally create an indicator column that indicates whether a group’s raters rated the same set of items or not.
I have no code to add below because I don’t have a clue about how to approach this at all. Is there anyway to get r to do this?
Thank you!