imed_meta_regression: Meta-regression with minimum-information guard

View source: R/advanced_validation.R

imed_meta_regressionR Documentation

Meta-regression with minimum-information guard

Description

Requires at least 10 independent effects by default and at least 5 effects per model coefficient. These are guardrails, not guarantees of adequate power.

Usage

imed_meta_regression(x, moderators, min_k = 10, method = "REML")

Arguments

x

A guarded analysis set that passes 'imed_meta_eligibility()'.

moderators

Character vector of field names in the measurement table to use as moderators.

min_k

Minimum number of independent effects required (default 10). At least 5 effects per model coefficient are also required.

method

Between-study variance estimator passed to 'metafor' (default '"REML"').

Value

A fitted random-effects meta-regression model of class 'c("rma.uni", "rma")' from 'metafor::rma.uni()', with the study identifiers as labels. The coefficients describe the change in the mean outcome associated with each moderator.

Examples

if (requireNamespace("metafor", quietly = TRUE)) {
  toy <- data.frame(
    Study_ID = paste0("S", 1:12),
    Comparability_Class = "CLASS_A",
    Reported_Unit = "items/L",
    Metric_Type = "Abundance",
    Strict_Synthesis_Eligibility = "YES",
    Group = rep(c("g1", "g2"), 6),
    Mean = c(2.1, 3.4, 1.8, 4.0, 2.9, 3.1, 2.4, 3.8, 1.9, 3.3, 2.7, 4.2),
    SD = rep(c(0.6, 0.9), 6),
    N = rep(c(10, 12, 8), 4)
  )
  imed_meta_regression(toy, moderators = "Group")
}

imedR documentation built on Nov. 3, 2026, 5:08 p.m.