library(dplyr)
library(volker)
data <- volker::chatgpt
# Prepare example data.
# First, recode "x" to TRUE/FALSE for the first coder's sample.
data_coder1 <- data |>
mutate(across(starts_with("cg_act_"), ~ ifelse(is.na(.), FALSE, TRUE))) %>%
mutate(coder = "coder one")
# Second, recode using a dictionary approach for the second coder's sample.
data_coder2 <- data |>
mutate(across(starts_with("cg_act_"), ~ ifelse(is.na(.), FALSE, TRUE))) %>%
mutate(cg_act_write = grepl("write|text|translate", tolower(cg_activities))) %>%
mutate(coder="coder two")
data_coded <- bind_rows(
data_coder1,
data_coder2
)
# Reliability coefficients are strictly only appropriate for manual codings
agree_tab(data_coded, cg_act_write, coder, case, method = "reli")
# Better use classification performance indicators to compare the
# dictionary approach with human coding
agree_tab(data_coded, cg_act_write, coder, case, method = "class")
Run the code above in your browser using DataLab