% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/netmetareg.R
\name{netmetareg.netmeta}
\alias{netmetareg.netmeta}
\alias{netmetareg}
\alias{netmetareg.default}
\alias{print.netmetareg}
\title{Network meta-regression with a single continuous or binary covariate}
\usage{
\method{netmetareg}{netmeta}(
  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, ...)

\method{netmetareg}{default}(x, ...)

\method{print}{netmetareg}(
  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,
  ...
)
}
\arguments{
\item{x}{An object of class \code{netmeta}.}

\item{covar}{Continuous or binary covariate.}

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

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

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

\item{level}{The level used to calculate confidence intervals for regression
coefficients.}

\item{reference.group}{Reference treatment.}

\item{direction1}{Directionality parameter for the first treatment group
when using UMIE models.}

\item{direction2}{Directionality parameter for the second treatment group
when using UMIE models.}

\item{nchar.trts}{A numeric defining the minimum number of
characters used to create unique treatment names.}

\item{\dots}{Additional arguments passed to \code{\link[metafor]{rma.mv}}.}

\item{digits}{Minimal number of significant digits, see
\code{print.default}.}

\item{digits.se}{Minimal number of significant digits for standard
errors.}

\item{digits.stat}{Minimal number of significant digits for z- or
t-value, see \code{print.default}.}

\item{digits.pval}{Minimal number of significant digits for p-value
of overall treatment effect, see \code{print.default}.}

\item{print.se}{A logical specifying whether standard errors should be
printed.}

\item{details.methods}{A logical specifying whether details on statistical
methods should be printed.}
}
\value{
An object of class \code{c("netmetareg", "rma.mv", "rma")}. Please
look at the help page of R function \code{\link[metafor]{rma.mv}}
for more details on the output from this function.

In addition, a list \code{.netmeta} is added to the output containing
the following components:
\item{x, covar, method.tau}{As defined above.}
\item{dots}{Information provided in argument '\dots{}'.}
\item{call}{Function call.}
\item{version}{Version of R package \bold{netmeta} used to create
  object.}
\item{version.metafor}{Version of R package \bold{metafor} used to
  create object.}
}
\description{
Network meta-regression with a single continuous or binary covariate for
objects of class \code{netmeta} (Kwarteng et al., 2026). This is a wrapper
function for \code{\link[metafor]{rma.mv}} in the R package \bold{metafor}
(Viechtbauer 2010).
}
\details{
This R function is a wrapper function for \code{\link[metafor]{rma.mv}} in
the R package \bold{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 \code{sm = "RR"}.

Argument '\dots{}' can be used to pass additional arguments to R
function \code{\link[metafor]{rma.mv}}. For example, argument
\code{control} to provide a list of control values for the
iterative estimation algorithm. See help page of R function
\code{\link[metafor]{rma.mv}} for more details.
}
\examples{
#
# 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")
}

}
\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 \emph{Research Square},
\doi{10.21203/rs.3.rs-8235913/v1}

Viechtbauer W (2010):
Conducting Meta-Analyses in R with the Metafor Package.
\emph{Journal of Statistical Software},
\bold{36}, 1--48
}
\seealso{
\code{\link{netmeta}}
}
\author{
Nana-adjoa Kwarteng
  \email{nana-adjoa.kwarteng@uniklinik-freiburg.de},
  Guido Schwarzer \email{guido.schwarzer@uniklinik-freiburg.de}
}
\keyword{models}
\keyword{regression}
