mtc.model: Generate network meta-analysis models

Description Usage Arguments Details Value Visualization Reproducible results Author(s) See Also Examples

View source: R/mtc.model.R

Description

The mtc.model function generates network meta-analysis models from an mtc.network object.

Usage

1
2
3
4
mtc.model(network, type = "consistency", factor = 2.5, n.chain = 4,
  likelihood=NULL, link=NULL, linearModel="random",
  om.scale=NULL, hy.prior=mtc.hy.prior("std.dev", "dunif", 0, "om.scale"),
  re.prior.sd=15 * om.scale, dic=TRUE, powerAdjust=NA, ...)

Arguments

network

An object of S3 class mtc.network

type

A string literal indicating the type of model (allowed values are "consistency", "regression", "nodesplit", "ume", or "use").

factor

Variance scaling factor for the starting values

n.chain

Number of chains in the model

likelihood

The likelihood to be used. If unspecified, a suitable likelihood will be inferred for the given data.

link

The link function to be used. If unspecified, a suitable link function will be inferred for the given data.

linearModel

The type of linear model to be generated. Can be "random" for a random effects model, or "fixed" for a fixed effect model.

om.scale

Outcome measure scale. Represents a "very large" difference on the analysis' outcome scale. This is used to set vague priors. For the log odds-ratio, values between 2 and 5 are considered reasonable. For continuous outcomes, this depends heavily on the specific outcome. If left unspecified, it is determined from the data.

hy.prior

Heterogeneity prior. See mtc.hy.prior.

re.prior.sd

Standard deviation for the relative effects prior (normal distribution).

dic

When set to TRUE, deviance and fitted values will be monitored to allow computation of the Deviance Information Criterion (DIC) at residual.

powerAdjust

Optional: the name of a column in the studies data frame of the mtc.network. This column must contain values between 0 and 1. The likelihood for each study will be adjusted by inflating the variance, where 0 means the study is excluded and 1 means it receives full weight. See details for more.

...

Additional arguments to be passed to the type-specific model generation function.

Details

The mtc.model function generates an object of S3 class mtc.model, which can be visualized by the generic plot function or summarized by the generic summary function.

These likelihood/links are supported:

Most likelihood/links follow [Dias et al. 2013a], and the binom/log model follows [Warn et al. 2002].

The following model types are supported:

Regressor specification: a list with elements: variable, coefficient, and either control or classes. The variable is the name of the covariate to include in the regression analysis, and must be a column of the studies data frame in the network. The regressor variable is automatically centered and standardized using the method recommended by Gelman et al. (2008). The coefficient indicates the type of treatment-interaction model: "shared", "unrelated", or "exchangeable". control, if specified, must be the ID of a treatment in the network. All other treatments have a coefficient relative to the control, which can be the same for all treatments ("shared"), different for all treatments ("unrelated") or exchangeable between treatments ("exchangeable"). classes is a named list of treatment classes, the first of which will act as the control class. Each class is a vector of treatment IDs from the network. Only "shared" coefficients can currently be used, meaning a single coefficient per class (except the control class). See also atrialFibrillation, certolizumab, and hfPrevention for examples of meta-regression analyses.

Studies can be downweighted by using the powerAdjust argument, which applies a variance inflation (also known as "power prior") to the likelihood. This allows a weight a[i] in [0, 1]) to be specified for each study i. The log-likelihood will be multiplied by a factor a[i], or equivalently for normal distributions the variance will be multiplied by 1/a[i]. Setting a[i] = 0 will completely exclude that study, whereas setting a[i] = 1 will weight it fully. Essentially, down-weighted models modify the data and hence model fit statistics such as DIC can not be compared between models with different weightings.

Value

An object of class mtc.model. The following elements are descriptive:

type

The type of model

network

Network the model was generated from

tree

Spanning tree formed by the basic parameters

var.scale

The scaling factor used to over-disperse starting values

likelihood

The likelihood used

link

The link function used

om.scale

The scale for the variance parameters

regressor

Regressor specification (regression models only): includes additional elements "center" and "scale" describing how the regressor input was standardized

These elements determine the model run by JAGS:

n.chain

The number of chains

code

Model code in JAGS syntax. Use cat() for proper formatting.

data

Data in JAGS compatible format

inits

Initial values in JAGS compatible format

monitors

The nodes of the JAGS model to monitor

dic

Whether to compute the DIC

These latter fields can be modified to alter the statistical model, but such changes may break the model or assumptions made elsewhere in the package.

Visualization

Calling the generic plot method on an S3 mtc.model object will show a graph with the treatments as vertices and the comparisons as edges. The lines with solid arrows represent basic parameters, and the other lines represent comparisons that are not associated with any parameter but do have direct evidence from trials.

The example code will generate the following graph:

Graph showing structure of a consistency model generated from parkison example data The default layout algorithm is igraph::layout.circle, other layout algorithms can be used by passing them as an optional argument called layout to plot. The igraph::layout.fruchterman.reingold algorithm also seems to produce nice results and may be better for large graphs.

Reproducible results

It is possible to get reproducible results, but as JAGS uses its own pseudo-random number generator, this is somewhat more involved.

mtc.model generates random numbers using the R functions (for example to generate initial values). Therefore, set.seed must be called before calling mtc.model.

Then, before calling mtc.run, the random number generator type and seed must be set for each of the chains. This can be done as documented in jags.model, by setting the .RNG.name and .RNG.seed for each chain in model$inits. See below for an example.

Author(s)

Gert van Valkenhoef, Joël Kuiper

See Also

mtc.network, mtc.run

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Random effects consistency model for Parkinson network
model <- mtc.model(parkinson)
plot(model)
summary(model)

# Fixed effect meta-regression for heart failure prevention
regressor <- list(coefficient='shared',
                  variable='secondary',
                  control='control')

model <- mtc.model(hfPrevention,
                   type="regression",
                   regressor=regressor,
                   linearModel="fixed")

# Reproducible results
# Set the R RNG seed
set.seed(42)
model <- mtc.model(parkinson, likelihood='normal', link='identity')
# By default, the model will have 4 chains - generate a seed for each
seeds <- sample.int(4, n = .Machine$integer.max)
# Apply JAGS RNG settings to each chain
model$inits <- mapply(c, model$inits, list(
  list(.RNG.name="base::Wichmann-Hill", .RNG.seed=seeds[1]),
  list(.RNG.name="base::Marsaglia-Multicarry", .RNG.seed=seeds[2]),
  list(.RNG.name="base::Super-Duper", .RNG.seed=seeds[3]),
  list(.RNG.name="base::Mersenne-Twister", .RNG.seed=seeds[4])), SIMPLIFY=FALSE)

Example output

Loading required package: coda
$Description
[1] "MTC consistency model: "

$Parameters
[1] "d.D.A" "d.D.B" "d.D.C" "d.D.E"

gemtc documentation built on Aug. 10, 2020, 5:07 p.m.