Fits a network meta-analysis using mars in multilevel or multivariate mode, where multilevel models always estimate flexible heterogeneity components across random levels.

network_meta(
  data,
  study_id,
  treatment_1,
  treatment_2,
  effect,
  variance,
  reference = NULL,
  model_type = c("multilevel", "multivariate"),
  heterogeneity = NULL,
  tau_components = c("comparison", "treatment"),
  nested_levels = NULL,
  moderators = NULL,
  estimation_method = "REML",
  varcov_type = "multilevel",
  within_varcov_type = NULL,
  sample_size = NULL,
  ci_level = 0.95,
  robustID = NULL,
  optim_method = "L-BFGS-B",
  tol = 1e+07,
  ...
)

Arguments

data

Data frame with one row per observed contrast.

study_id

Study ID column.

treatment_1

First treatment column.

treatment_2

Second treatment column.

effect

Effect-size column interpreted as treatment_2 minus treatment_1.

variance

Sampling-variance column.

reference

Optional reference treatment.

model_type

"multilevel" or "multivariate".

heterogeneity

For "multilevel", must be "flexible". For "multivariate", "common" or "flexible".

tau_components

Flexible multilevel random-component choice.

nested_levels

Optional character vector of additional nested random-effect levels for multilevel models.

moderators

Optional moderators to include in both model types. Either a one-sided formula (e.g., ~ age + risk) or a character vector of column names.

estimation_method

Estimation method passed to mars.

varcov_type

Variance-covariance type passed to mars.

within_varcov_type

For multivariate models, optional override for within-study covariance type used by estimation. Defaults to varcov_type.

ci_level

Confidence level used for normal-approximation confidence intervals reported for direct, indirect, and total effects. Must be in (0, 1). Default is 0.95.

robustID

Optional cluster column name for cluster-robust standard errors (for example, study ID).

sample_size

Optional sample-size column for multivariate mode.

optim_method

Optimization method passed to mars.

tol

Optimization tolerance passed to mars.

...

Additional arguments passed to mars.

Value

An object of class nma_mars with fitted model output, direct/indirect/total effects (including standard errors and evidence counts), an evidence summary, incoherence-factor summaries (per-comparison and global), heterogeneity summaries (including Q for multilevel random levels and tau^2 by component/level), a contribution matrix ( fixed-effect coefficient summaries with Hessian-to-sandwich SE fallback, moderator metadata, resolved within-study covariance type, stored within-study covariance blocks for multivariate fits, cluster-robust settings/output, and treatment ordering.