library(metacor)
# Example dataset (for pre/post design only)
df <- data.frame(
  study_name = c("Study1", "Study2", "Study3", "Study4","Study5", "Study6", "Study7", "Study8", "Study9"),
  p_value_Int = c(1.038814e-07, NA, NA, NA, NA, 2.100000e-02, NA, NA, NA),
  n_Int = c(10, 10, 10, 10, 15, 15, 10, 10, 10),
  meanPre_Int = c(8.17, 10.09, 10.18, 9.85, 9.51,7.70, 10.00,  11.53, 11.20),
  meanPost_Int = c(10.12, 12.50, 12.56,10.41, 10.88, 9.20, 10.80,13.42,12.00),
  sd_pre_Int = c(1.83,0.67,0.66,0.90,0.62, 0.90, 0.70, 0.60, 1.90),
  sd_post_Int = c(1.85, 0.72, 0.97, 0.67, 0.76, 1.10, 0.70,0.80,1.80),
  upperCI_Int = c(NA, NA,NA, NA,NA, NA,NA, NA, NA),
  lowerCI_Int = c(NA, NA,NA, NA,NA, NA,NA, NA, NA))
results <- metacor_dual(df,
                        digits = 3,
                        method = "both",
                        apply_hedges = TRUE,
                        add_to_df = TRUE,
                        SMD_method = "SMDpre",
                        MeanDifferences = TRUE,
                        impute_method = "cv",
                        verbose = TRUE,
                        report_imputations = TRUE,
                        custom_sd_diff_int = NULL,
                        custom_sd_diff_con = NULL,
                        single_group = TRUE)
#> Imputed sd_diff_int at row 2 using 'cv' (global median): 0.7200
#> Imputed sd_diff_int at row 3 using 'cv' (global median): 0.7111
#> Imputed sd_diff_int at row 4 using 'cv' (global median): 0.1673
#> Warning in metacor_dual(df, digits = 3, method = "both", apply_hedges = TRUE, : Row 4: Imputed sd_diff_int = 0.1673 gives r_int = 1.0207 (outside [-0.9999, 0.9999]).
#> Suggested sd_diff_int range: [0.2303, 1.5700].
#>  r_int not assigned.
#> Imputed sd_diff_int at row 5 using 'cv' (global median): 0.4093
#> Warning in metacor_dual(df, digits = 3, method = "both", apply_hedges = TRUE, : Row 6: Imputed sd_diff_int = 2.2349 gives r_int = -1.5024 (outside [-0.9999, 0.9999]).
#> Suggested sd_diff_int range: [0.2005, 2.0000].
#>  r_int not assigned.
#> Imputed sd_diff_int at row 7 using 'cv' (global median): 0.2390
#> Imputed sd_diff_int at row 8 using 'cv' (global median): 0.5647
#> Imputed sd_diff_int at row 9 using 'cv' (global median): 0.2390