crossnma {crossnma}R Documentation

Run JAGS to fit cross NMA and NMR

Description

This function takes the JAGS model from an object produced by crossnma.model and runs it using jags.model in rjags package.

Usage

crossnma(
  x,
  n.adapt = 1000,
  n.burnin = floor(n.iter/2),
  n.iter = 10000,
  thin = 1,
  n.chains = 2,
  quiet = TRUE,
  monitor = NULL
)

Arguments

x

An object produced by crossnma.model.

n.adapt

Number of adaptations for the MCMC chains. Default is 1000.

n.burnin

Number of burnin iterations for the MCMC chains.

n.iter

Number of iterations for the MCMC chains.

thin

Number of thinning for the MCMC chains. Default is 1.

n.chains

Number of MCMC chains. Default is 2.

quiet

A logical passed on to jags.model.

monitor

A vector of additional parameters to monitor. Default is NULL.

Value

An object of class crossnma which is a list containing the following components:

samples

The MCMC samples produced by running the JAGS model.

model

The crossnma.model object obtained from crossnma.model which was used to run JAGS.

trt.key

A table of treatment names and their correspondence to integers used in the JAGS model.

call

Function call.

version

Version of R package crossnma used to create object.

Author(s)

Tasnim Hamza tasnim.hamza@ispm.unibe.ch, Guido Schwarzer sc@imbi.uni-freiburg.de

See Also

crossnma.model, jags.model

Examples

# We conduct a network meta-analysis assuming a random-effects
# model.
# The data comes from randomized-controlled trials and
# non-randomized studies (combined naively)
head(ipddata) # participant-level data
head(stddata) # study-level data

# Create a JAGS model
mod <- crossnma.model(treat, id, relapse, n, design,
  prt.data = ipddata, std.data = stddata,
  reference = "A", trt.effect = "random", method.bias = "naive")

# Fit JAGS model
# (suppress warning 'Adaptation incomplete' due to n.adapt = 20)
fit <-
  suppressWarnings(crossnma(mod, n.adapt = 20,
    n.iter = 50, thin = 1, n.chains = 3))

# Display the output
summary(fit)
plot(fit)


[Package crossnma version 1.0.1 Index]