% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/netcomparison.R
\name{netcomparison}
\alias{netcomparison}
\alias{print.netcomparison}
\title{Calculate comparison effects of two arbitrary complex interventions
in component network meta-analysis}
\usage{
netcomparison(
  x,
  treat1,
  treat2,
  common = x$common,
  random = x$random,
  level = x$level.ma,
  nchar.comps = x$nchar.comps,
  backtransf = x$backtransf,
  warn.deprecated = gs("warn.deprecated"),
  ...
)

\method{print}{netcomparison}(
  x,
  common = x$common,
  random = x$random,
  backtransf = x$backtransf,
  nchar.comps = x$nchar.comps,
  digits = gs("digits"),
  digits.stat = gs("digits.stat"),
  digits.pval = gs("digits.pval"),
  scientific.pval = gs("scientific.pval"),
  zero.pval = gs("zero.pval"),
  JAMA.pval = gs("JAMA.pval"),
  big.mark = gs("big.mark"),
  legend = gs("legend"),
  warn.deprecated = gs("warn.deprecated"),
  ...
)
}
\arguments{
\item{x}{An object of class \code{netcomb} or \code{netcomparison}
(print function).}

\item{treat1}{A character vector defining the first complex
intervention(s).}

\item{treat2}{A character vector defining the second complex
intervention(s).}

\item{common}{A logical indicating whether results for common
effects model should be conducted.}

\item{random}{A logical indicating whether results for random
effects model should be conducted.}

\item{level}{The level used to calculate confidence intervals for
combinations of components.}

\item{nchar.comps}{A numeric defining the minimum number of
characters used to create unique names for components (see
Details).}

\item{backtransf}{A logical indicating whether printed results
should be back transformed. If \code{backtransf=TRUE}, results
for \code{sm="OR"} are printed as odds ratios rather than log
odds ratios.}

\item{warn.deprecated}{A logical indicating whether warnings should
be printed if deprecated arguments are used.}

\item{\dots}{Additional arguments (to catch deprecated arguments).}

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

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

\item{digits.pval}{Minimal number of significant digits for
p-values, see \code{print.default}.}

\item{scientific.pval}{A logical specifying whether p-values should
be printed in scientific notation, e.g., 1.2345e-01 instead of
0.12345.}

\item{zero.pval}{A logical specifying whether p-values should be
printed with a leading zero.}

\item{JAMA.pval}{A logical specifying whether p-values for test of
combination effect should be printed according to JAMA reporting
standards.}

\item{big.mark}{A character used as thousands separator.}

\item{legend}{A logical indicating whether a legend should be
printed.}
}
\value{
A list is returned by the function \code{netcomparison} with the
following elements:
\item{comparison}{Comparison.}
\item{TE.common, TE.random}{A vector of comparison effects (common
  and random effects model).}
\item{seTE.common, seTE.random}{A vector with corresponding standard
  errors (common and random effects model).}
\item{lower.common, lower.random}{A vector with lower confidence
  limits for comparisons (common and random effects model).}
\item{upper.common, upper.random}{A vector with upper confidence
  limits for comparisons (common and random effects model).}
\item{statistic.common, statistic.random}{A vector with z-values for
  the overall effect of comparisons (common and random effects
  model).}
\item{pval.common, pval.random}{A vector with p-values for the
  overall effect of comparisons (common and random effects model).}
\item{trts}{Treatments included in comparisons.}
\item{comps}{Components included in comparisons.}
\item{treat1, treat2}{A defined above.}
\item{common, random}{A defined above.}
\item{level, nchar.comps, backtransf, x}{A defined above.}
\item{B.matrix}{B matrix.}
\item{C.matrix}{C matrix.}
}
\description{
Calculate comparison effects of two arbitrary complex interventions
(i.e., combinations of several components) in component network
meta-analysis.
}
\details{
R functions \code{\link{netcomb}} and \code{\link{discomb}}
calculate effects for individual components and complex
interventions present in the component network meta-analysis
(CNMA). This function can be used to calculate the effect for
comparisons of two arbitrary complex interventions defined by
arguments \code{treat1} and \code{treat2}.

All complex interventions occuring in the network are considered
for the first complex intervention if argument \code{treat1} is
missing. The reference group defined in the (C)NMA is used as
second complex intervention if argument \code{treat2} is
missing. The first complex intervention in the (C)NMA is used if
the reference group is not defined.

The following matrices are needed to calculate comparison effects
of arbitrary complex interventions, (Rücker et al., 2020, Section
3.2):
\itemize{
\item B matrix describing how comparisons are composed by complex
  intervetions,
\item C matrix describing how the complex interventions are
  composed by the components.
}
Internally, both matrices are constructed based on arguments
\code{x}, \code{treat1} and \code{treat2}.

By default, component names are not abbreviated in
printouts. However, in order to get more concise printouts,
argument \code{nchar.comps} can be used to define the minimum
number of characters for abbreviated component names (see
\code{\link{abbreviate}}, argument \code{minlength}). R function
\code{\link{treats}} is utilised internally to create abbreviated
component names.
}
\note{
R function \code{\link{netcomplex}} can be used to calculate the
effect for arbitrary complex interventions in a component network
meta-analysis.
}
\examples{
# Only consider studies including Face-to-face PST (to reduce
# runtime of example)
#
face <- subset(Linde2016, id \%in\% c(16, 24, 49, 118))

# Use pairwise() to transform data to comparison-based format
#
pw <- pairwise(treat = int,
  event = resp, n = n, studlab = paste(author, year),
  data = face, reference = "plac", sm = "OR")

# Conduct random effects network meta-analysis
#
nma1 <- netmeta(pw, common = FALSE)

# Additive model for treatment components (with placebo as inactive
# treatment)
#
cnma1 <- netcomb(nma1, inactive = "placebo")

# Result for comparison Face-to-face PST vs TCA
netcomparison(cnma1, "Face-to-face PST", "TCA", nchar.comps = 4)
netcomparison(cnma1, "F", "T", nchar.comps = 4)

# Result for comparison Face-to-face PST vs TCA + Placebo
netcomparison(cnma1, "Face-to-face PST", "TCA + Plac", nchar.comps = 4)

\donttest{
# Forest plots
#
t1 <- c("F + TCA", "F + Plac", "SSRI + Plac + TCA")
t2 <- c("UC", "Plac", "UC")
#
netcomparison(cnma1, t1, t2)
#
forest(netcomparison(cnma1, t1, t2))
forest(netcomparison(cnma1, t1, t2), nchar.comps = 4)
forest(netcomparison(cnma1, c("F", "TCA"), "UC"), nchar.comps = 4)

# Artificial example
#
treat1 <- rep("A", 3)
treat2 <- c("B+C", "A+C", "C+D")
TE <- c(0, 1, 0)
seTE <- rep(1, 3)
# Conduct (C)NMA
nma2 <- netmeta(TE, seTE, treat1, treat2, random = FALSE)
cnma2 <- netcomb(nma2)

# Result for comparison A vs B + D
netcomparison(cnma2, "A", "B + D")
# Same results
netcomparison(cnma2, "A", "B+D")
netcomparison(cnma2, "A", "D+B")
netcomparison(cnma2, "a", "d+b")

# Generated B matrix
netcomparison(cnma2, "A", "B + D")$C.matrix
# Generated B matrix
netcomparison(cnma2, "A", "B + D")$B.matrix
}

}
\references{
Rücker G, Petropoulou M, Schwarzer G (2020):
Network meta-analysis of multicomponent interventions.
\emph{Biometrical Journal},
\bold{62}, 808--21
}
\seealso{
\code{\link{netcomb}}, \code{\link{discomb}},
  \code{\link{netcomplex}}
}
\author{
Guido Schwarzer \email{guido.schwarzer@uniklinik-freiburg.de}
}
