Type: Package
Title: Meta-Analytic Effect Size Calculation for Pre-Post Designs with Correlation Imputation
Version: 1.2.1
Description: Tools for the calculation of effect sizes (standardised mean difference) and mean difference in pre-post controlled studies, including robust imputation of missing variances (standard deviation of changes) and correlations (Pearson correlation coefficient). The main function 'metacor_dual()' implements several methods for imputing missing standard deviation of changes or Pearson correlation coefficient, and generates transparent imputation reports. Designed for meta-analyses with incomplete summary statistics. For details on the methods, see Higgins et al. (2023) and Fu et al. (2013).
License: MIT + file LICENSE
URL: https://github.com/ikerugr/metacor, https://ikerugr.r-universe.dev/metacor
BugReports: https://github.com/ikerugr/metacor/issues
Depends: R (≥ 3.6)
Imports: stats, officer, stringr
Suggests: knitr, rmarkdown, testthat (≥ 3.0.0)
Config/testthat/edition: 3
Encoding: UTF-8
RoxygenNote: 7.3.2
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2025-12-09 15:31:20 UTC; Iker
Author: Iker J. Bautista [aut, cre], Saul M. Rodriguez [ctb]
Maintainer: Iker J. Bautista <ikerugr@gmail.com>
Repository: CRAN
Date/Publication: 2025-12-09 16:20:02 UTC

Check internal consistency of meta-analytic summary data

Description

This function takes the output of metacor_dual() and performs a set of internal consistency checks (p-values, confidence intervals, SD of the difference vs. feasible range, and extreme correlations). Optionally, it also adds a human-readable interpretation of the detected issues for each study.

Usage

check_metacor_consistency(
  df,
  tolerance_p = 0.01,
  tolerance_CI = 0.1,
  r_extreme = 0.99,
  interpret = FALSE
)

Arguments

df

A data frame, typically the output of metacor_dual().

tolerance_p

Numeric. Maximum acceptable absolute difference between reported and reconstructed p-values.

tolerance_CI

Numeric. Maximum acceptable absolute difference between reported and reconstructed confidence interval limits.

r_extreme

Numeric. Threshold above which correlations (in absolute value) are flagged as extreme.

interpret

Logical. If TRUE, add character columns summary_int (and summary_con, if applicable) with a brief narrative interpretation of the flags for each study.

Value

The same data frame df with additional logical flag columns (e.g., flag_p_mismatch_int, flag_CI_mismatch_int, etc.), and, if interpret = TRUE, one or two character columns with textual summaries.

Examples

## Not run: 
  res <- metacor_dual(dat, MeanDifferences = TRUE)
  res_checked <- check_metacor_consistency(res, interpret = TRUE)

## End(Not run)

Effect Sizes and Imputation for Meta-Analysis of Pre-Post Studies and Pre-Post intervention and control groups studies (metacor_dual)

Description

Calculates effect sizes (i.e., SMDpre, SMDchange, ScMDpooled, ScMDpre) and allows for various imputation methods (i.e., none, cv, direct, mean) for missing SDdiff and correlation coefficients in pre-post meta-analyses, with or without a control group. Generates a detailed imputation report in Word format.

Usage

metacor_dual(
  df,
  digits = NULL,
  add_to_df = TRUE,
  method = "both",
  apply_hedges = TRUE,
  SMD_method = "SMDpre",
  MeanDifferences = FALSE,
  impute_method = "none",
  verbose = TRUE,
  report_imputations = FALSE,
  custom_sd_diff_int = NULL,
  custom_sd_diff_con = NULL,
  single_group = FALSE
)

Arguments

df

Data frame with the necessary columns for intervention and (optionally) control groups.

digits

Number of decimal places to round results (default: NULL).

add_to_df

Logical. If TRUE, results are added to the original data frame.

method

Method for SDdiff calculation (i.e., 'p_value', 'ci', 'both').

apply_hedges

Logical. Apply Hedges' g correction? (default: TRUE)

SMD_method

Method for effect size (i.e., 'SMDpre', 'SMDchange', 'ScMDpooled', 'ScMDpre').

MeanDifferences

Logical. Calculate mean differences and variances? (default: FALSE)

impute_method

Imputation method for missing SDdiff (i.e., 'none', 'direct', 'mean', 'cv').

verbose

Logical. Print messages during processing? (default: TRUE)

report_imputations

Logical. Generate Word imputation report? (default: FALSE)

custom_sd_diff_int

List with elements 'row' and 'value' for manual sd_diff_int values.

custom_sd_diff_con

List with elements 'row' and 'value' for manual sd_diff_con values.

single_group

Logical. Is the design single-group only? (default: FALSE)

Value

Data frame with calculated variables. Optionally, a Word report ('imputation_report.docx') is generated.

References

Higgins, J. P. T., Thomas, J., Chandler, J., Cumpston, M., Li, T., Page, M. J., & Welch, V. A. (Eds.). (2023). Cochrane handbook for systematic reviews of interventions (Version 6.3). Cochrane. https://training.cochrane.org/handbook Fu, R., Vandermeer, B.W., Shamliyan, T.A., ONeil, M.E., Yazdi, F., Fox, S.H., & Morton, S.C. (2013). Handling Continuous Outcomes in Quantitative Synthesis. Methods Guide for Comparative Effectiveness Reviews. AHRQ Publication No. 13-EHC103-EF. https://effectivehealthcare.ahrq.gov/reports/final.cfm

Examples

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)
)
result <- metacor_dual(df)
print(result)