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

### FFM Publication bias check

data_FFM_emg <- data_FFM %>% filter(DV == 1 & INCLUDE_IN_ANALYSIS == 1)
data_FFM_eff <- data_FFM %>% filter(INCLUDE_AS_JUDGE_OP == 1)  


pub_bias_emg <- TF_analysis(data_FFM_emg, IV_name = "IV")
# Egger's test showed that nothing is significant, except for agreeableness.
pub_bias_emg$regs
# For agreeableness, the corrected T&F rho = .15
pub_bias_emg$tfs

pub_bias_eff <- TF_analysis(data_FFM_eff, IV_name = "IV")
# Egger's test showed that nothing is significant.
pub_bias_eff$regs
# But we can check for T&F results anyway.
pub_bias_eff$tfs


### HEXACO Publication bias check
data_HEXACO_emg <- data_HEXACO %>% filter(DV == 1 & INCLUDE_TYPE == 1)
data_HEXACO_eff <- data_HEXACO %>% filter(INCLUDE_AS_JUDGE_OP == 1)


pub_bias_HEXACO_emg <- TF_analysis_HEX(data_HEXACO_emg, IV_name = "IV")
# Egger's test showed that nothing is significant.
pub_bias_HEXACO_emg$regs
# But we can check for T&F results anyway.
pub_bias_HEXACO_emg$tfs

pub_bias_HEXACO_eff <- TF_analysis_HEX(data_HEXACO_eff, IV_name = "IV")
# Egger's test showed that nothing is significant, except for conscientiousness.
pub_bias_HEXACO_eff$regs
# For conscientiousness, the corrected T&F rho = .48
pub_bias_HEXACO_eff$tfs$C


