Learn R Programming

orchaRd (version 2.2.1)

glmmTMB_to_rma: Convert a glmmTMB model to an rma.mv-compatible object

Description

Wraps a fitted glmmTMB model in a light-weight object with class c("rma.mv", "rma") so it can be passed to orchaRd functions that operate on metafor model objects. The main use-case is multilevel meta-analysis fitted with glmmTMB, including models that use structured covariance terms such as equalto() and propto().

Usage

glmmTMB_to_rma(
  model,
  yi,
  vi,
  data = NULL,
  V = NULL,
  measure = NULL,
  test = "z",
  ddf = NULL,
  study_col = NULL
)

Value

A list of class c("rma.mv", "rma") containing the slots that

orchaRd and metafor summary helpers expect.

Arguments

model

A fitted glmmTMB model object.

yi

Name of the effect-size column in data (character), or a numeric vector of effect sizes.

vi

Name of the sampling-variance column in data (character), or a numeric vector of sampling variances.

data

Optional data frame. Defaults to model$frame.

V

Optional known sampling-error variance-covariance matrix. Supply the same matrix used in equalto() if you want orchaRd::i2_ml(method = "matrix") to work on the converted object.

measure

Character string labelling the effect-size metric. Stored as an attribute on yi. Defaults to "GEN".

test

Either "z" or "t".

ddf

Optional denominator degrees of freedom used when test = "t".

study_col

Optional study-level grouping variable used for automatic ddf calculation when test = "t" and ddf = NULL.

Details

The returned object is intended for analytical summaries and plotting functions that only consume the fitted model components. Workflows that require refitting a metafor model, such as leave_one_out() or bootstrap paths inside some heterogeneity helpers, are not supported for converted objects.