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,
  inits = NULL,
  n.adapt = 1000,
  n.burnin = floor(n.iter/2),
  n.iter = 2000,
  thin = max(1, floor((n.iter - n.burnin)/1000)),
  n.chains = 2,
  monitor = NULL,
  level.ma = x$level.ma,
  backtransf = x$backtransf,
  quiet = TRUE,
  n.thin = NULL
)

Arguments

x

An object produced by crossnma.model.

inits

A list of lists with n.chains elements; each element contains initial values for each model parameter or a function that generates starting values. Default is different numbers in .RNG.seed and .RNG.name = "base::Mersenne-Twister".

n.adapt

Number of adaptations for the MCMC chains.

n.burnin

Number of burnin iterations for the MCMC chains. Default is n.iter / 2 which discards the first half of the iterations.

n.iter

Number of iterations to run each MCMC chain.

thin

Thinning for the MCMC chains. Default is max(1, floor((n.iter - n.burnin) / 1000)), that is only thinning if there are more than 2000 iterations.

n.chains

Number of MCMC chains.

monitor

A character vector of the names of the parameters to be monitored. Basic parameters (depends on the analysis) will be automatically monitored and only additional parameters need to be specified.

level.ma

The level used to calculate credible intervals for network estimates.

backtransf

A logical indicating whether results should be back transformed in printouts. If backtransf = TRUE, results for sm = "OR" are presented as odds ratios rather than log odds ratios, for example.

quiet

A logical passed on to jags.model.

n.thin

Deprecated argument (replaced by thin).

Value

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

jagsfit

An "rjags" object produced when rjags package used to run 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.

inits, n.adapt, n.burnin, n.iter

As defined above.

thin, n.chains

As defined above.

call

Function call.

version

Version of R package crossnma used to create object.

Author(s)

Tasnim Hamza tasnim.hamza@ispm.unibe.ch, Guido Schwarzer guido.schwarzer@uniklinik-freiburg.de

See Also

crossnma.model, jags.model

Examples

## Not run: 
# 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
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
set.seed(1909)
fit <- crossnma(mod)

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

## End(Not run)


[Package crossnma version 1.2.0 Index]