Learn R Programming

netmeta (version 3.6-0)

netmetareg.netmeta: Network meta-regression with a single continuous or binary covariate

Description

Network meta-regression with a single continuous or binary covariate for objects of class netmeta (Kwarteng et al., 2026). This is a wrapper function for rma.mv in the R package metafor (Viechtbauer 2010).

Usage

# S3 method for netmeta
netmetareg(
  x,
  covar = NULL,
  consistency = TRUE,
  assumption = "independent",
  method.tau = if (!x$random) "FE" else "REML",
  level = x$level.ma,
  reference.group = x$reference.group,
  direction1 = NULL,
  direction2 = NULL,
  nchar.trts = x$nchar.trts,
  ...
)

netmetareg(x, ...)

# S3 method for default netmetareg(x, ...)

# S3 method for netmetareg print( x, digits = gs("digits"), digits.se = gs("digits.se"), digits.stat = gs("digits.stat"), digits.pval = gs("digits.pval"), print.se = FALSE, details.methods = TRUE, ... )

Value

An object of class c("netmetareg", "rma.mv", "rma"). Please look at the help page of R function rma.mv

for more details on the output from this function.

In addition, a list .netmeta is added to the output containing the following components:

x, covar, method.tau

As defined above.

dots

Information provided in argument '...'.

call

Function call.

version

Version of R package netmeta used to create object.

version.metafor

Version of R package metafor used to create object.

Arguments

x

An object of class netmeta.

covar

Continuous or binary covariate.

consistency

A logical indicating whether a consistency or unrelated mean interaction effect (UMIE) model should be assumed.

assumption

A character string indicating which assumption is done for the covariate; either "independent" or "common" (can be abbreviated).

method.tau

A character string indicating which method is used to estimate the between-study variance tau-squared. Either "FE", "REML", or "ML".

level

The level used to calculate confidence intervals for regression coefficients.

reference.group

Reference treatment.

direction1

Directionality parameter for the first treatment group when using UMIE models.

direction2

Directionality parameter for the second treatment group when using UMIE models.

nchar.trts

A numeric defining the minimum number of characters used to create unique treatment names.

...

Additional arguments passed to rma.mv.

digits

Minimal number of significant digits, see print.default.

digits.se

Minimal number of significant digits for standard errors.

digits.stat

Minimal number of significant digits for z- or t-value, see print.default.

digits.pval

Minimal number of significant digits for p-value of overall treatment effect, see print.default.

print.se

A logical specifying whether standard errors should be printed.

details.methods

A logical specifying whether details on statistical methods should be printed.

Details

This R function is a wrapper function for rma.mv in the R package metafor (Viechtbauer 2010).

Note, results are not back-transformed in printouts of network meta-analyses using summary measures with transformations, e.g., log risk ratios are printed instead of the risk ratio if argument sm = "RR".

Argument '...' can be used to pass additional arguments to R function rma.mv. For example, argument control to provide a list of control values for the iterative estimation algorithm. See help page of R function rma.mv for more details.

References

Kwarteng N, Evrenoglou T, Mueller J, Elsaesser M, Schramm E, Schwarzer G, Nikolakopoulou A (2026): Illustrating the assumptions of meta-regression in treatment networks. Preprint available at Research Square, tools:::Rd_expr_doi("10.21203/rs.3.rs-8235913/v1")

Viechtbauer W (2010): Conducting Meta-Analyses in R with the Metafor Package. Journal of Statistical Software, 36, 1--48

See Also

netmeta

Examples

Run this code
#
# 1) Smoking cessation example
#
data(smokingcessation)
# Add variable with (fictitious) risk of bias values
# with 1 = "low risk" and 2 = "high risk"
#
smokingcessation$rob <- rep(1:2, 12)

pw1 <- pairwise(list(treat1, treat2, treat3),
  event = list(event1, event2, event3), n = list(n1, n2, n3),
  data = smokingcessation, sm = "OR")

# Run network meta-analysis (NMA)
nma1 <- netmeta(pw1, common = FALSE, ref = "A")

# Network meta-regression with continuous covariate and assumption of
# independent slopes
nr1 <- netmetareg(nma1, rob)
nr1

# \donttest{
# 2) Pain Prevention of Propofol Injection Example (Jalota2011)
#
# Create pairwise object
pw2 <- pairwise(treat = trt, event =  pain, n = n,
  studlab = id, data = Jalota2011, sm = "OR")

# Run network meta-analysis (NMA)
nma2 <- netmeta(pw2, common = FALSE, ref = "Hand vein")

# NMR with independent and consistent assumption (default)
nmr2_i <- netmetareg(nma2, covar = seTE, consistency = TRUE,
  assumption = "i")
# NMR with common and consistent assumption
nmr2_c <- netmetareg(nma2, covar = seTE, consistency = TRUE,
  assumption = "c")
# NMR with independent UMIE model (no consistency in interactions) using
# default treatment order
nmr2_i_umie <- netmetareg(nma2, covar = seTE, consistency = FALSE,
  assumption = "i")

# 3) Physical therapy example (Hong 2015)
#
dat3 <- Hong2015
# Externally create a customizable treatment order indicator variable,
# which will later be modified
dat3$trtnum <- as.numeric(as.factor(dat3$trt))
dat3 <- do.call(rbind, lapply(split(dat3, dat3$id),
  function(x) {
    x$direction <- ifelse(x$trtnum == min(x$trtnum), 0, 1)
  x}))

pw3 <- pairwise(treat = trt, mean = mean_pain, n = n, sd = sd_pain,
  studlab=id, data = dat3, sm = "MD")
# Create difference variable for covariate
pw3$disability_diff <- pw3$mean_disability1 - pw3$mean_disability2

# Update directionality parameters so that they will exclude imputed values
sel.NA <- is.na(pw3$disability_diff)
pw3$direction1[sel.NA] <- 0
pw3$direction2[sel.NA] <- 0

# Mean imputations for missing covariate values
pw3$disability_diff[sel.NA] <- mean(pw3$disability_diff, na.rm = TRUE)

# NMA
nma3 <- netmeta(pw3, common = FALSE, ref = "No treatment")

# NMR with independent and consistent assumption (default)
nmr3_i <- netmetareg(nma3, covar = disability_diff, consistency = TRUE,
  assumption = "i")
# NMR with common and consistent assumption
nmr3_c <- netmetareg(nma3, covar = disability_diff, consistency = TRUE,
  assumption = "c")
# NMR with independent UMIE model (no consistency in interactions) using
# default treatment order variable
nmr3_i_umie <- netmetareg(nma3, covar = disability_diff, consistency = FALSE,
  assumption = "i")
# NMR with independent UMIE model (no consistency in interactions) using
# custom treatment order variable which excludes the mean imputations from
# interaction estimation
nmr3_i_umie_noimp <- netmetareg(nma3, covar = disability_diff,
  consistency = FALSE, assumption = "i",
   direction1 = "direction1", direction2 = "direction2")
# NMR with common UMIE model (no consistency in interactions) using default
# treatment order variable
nmr3_c_umie <- netmetareg(nma3, covar = disability_diff, consistency = FALSE,
  assumption = "c")
# NMR with common UMIE model (no consistency in interactions) using custom
# treatment order variable which excludes the mean imputations from
# interaction estimation
nmr3_c_umie_noimp <- netmetareg(nma3, covar = disability_diff,
  consistency = FALSE, assumption = "c",
  direction1 = "direction1", direction2 = "direction2")
# }

Run the code above in your browser using DataLab