source("../Utilities/Utilities-Main.R")
source("../Utilities/Utilities-Extra.R")


### Effectiveness
data_FFM_eff <- data_FFM %>% filter(INCLUDE_AS_JUDGE_OP == 1)  


# table(data_FFM_eff$`Article ID`)

results <- BF_analysis(data_FFM_eff, IV_name = "IV", 
                       var_names = list(rxx = "rxx", ryy = "ryy", rxy = "rxy", N = "N"))
results$overall[c("E", "A", "C", "N", "O")]


eff_E <- data_FFM_eff %>% filter(IV == 3)
eff_A <- data_FFM_eff %>% filter(IV == 4)
eff_C <- data_FFM_eff %>% filter(IV == 2)
eff_N <- data_FFM_eff %>% filter(IV == 5)
eff_O <- data_FFM_eff %>% filter(IV == 1)

# p = .0266, k = 68
calculation_mod(eff_E, mods = eff_E$Collectivism, method = "HS")$result 
calculation_mod(eff_E, mods = eff_E$Collectivism)$detail_CI

# p = .0356, k = 53
calculation_mod(eff_A, mods = eff_A$Collectivism, method = "HS")$result
calculation_mod(eff_A, mods = eff_A$Collectivism)$detail_CI


calculation_mod(eff_C, mods = eff_C$Collectivism, method = "HS")$result
calculation_mod(eff_N, mods = eff_N$Collectivism, method = "HS")$result
calculation_mod(eff_O, mods = eff_O$Collectivism, method = "HS")$result


data_HEXACO_eff <- data_HEXACO %>% filter(INCLUDE_AS_JUDGE_OP == 1)

eff_HH <- data_HEXACO_eff %>% filter(IV == 6)
eff_EE <- data_HEXACO_eff %>% filter(IV == 5)
eff_XX <- data_HEXACO_eff %>% filter(IV == 3)
eff_AA <- data_HEXACO_eff %>% filter(IV == 4)
eff_CC <- data_HEXACO_eff %>% filter(IV == 2)
eff_OO <- data_HEXACO_eff %>% filter(IV == 1)

calculation_mod(eff_HH, mods = eff_HH$Collectivism, method = "HS")$detail_CI
calculation_mod(eff_EE, mods = eff_EE$Collectivism, method = "HS")$detail_CI
calculation_mod(eff_XX, mods = eff_XX$Collectivism, method = "HS")$detail_CI
calculation_mod(eff_AA, mods = eff_AA$Collectivism, method = "HS")$detail_CI
calculation_mod(eff_CC, mods = eff_CC$Collectivism, method = "HS")$detail_CI
calculation_mod(eff_OO, mods = eff_OO$Collectivism, method = "HS")$detail_CI

