crossnma.model {crossnma}  R Documentation 
This function creates a JAGS model and the needed data for crossdesign and crossformat network metaanalysis or metaregression of a binary outcome with the odds ratio as effect measure.
crossnma.model(
trt,
study,
outcome,
n,
design,
cov1 = NULL,
cov2 = NULL,
cov3 = NULL,
bias = NULL,
unfav = NULL,
bias.covariate = NULL,
bias.group = NULL,
prt.data = NULL,
std.data = NULL,
reference = NULL,
trt.effect = "random",
cov1.ref = NULL,
cov2.ref = NULL,
cov3.ref = NULL,
reg0.effect = "independent",
regb.effect = "random",
regw.effect = "random",
split.regcoef = TRUE,
method.bias = NULL,
bias.type = NULL,
bias.effect = "common",
down.wgt = NULL,
prior = list(tau.trt = NULL, tau.reg0 = NULL, tau.regb = NULL, tau.regw = NULL,
tau.gamma = NULL, pi.high.rct = NULL, pi.low.rct = NULL, pi.high.nrs = NULL,
pi.low.nrs = NULL),
run.nrs = list(var.infl = 1, mean.shift = 0, trt.effect = "common", n.adapt = 2000,
n.iter = 10000, n.burnin = 4000, thin = 1, n.chains = 2),
quiet = TRUE
)
trt 
Treatment variable in prt.data and std.data. 
study 
Study variable in prt.data and std.data. 
outcome 
Outcome variable in prt.data and std.data. 
n 
Number of participants in std.data. 
design 
Design variable in prt.data and std.data. 
cov1 
Optional first covariate in prt.data and std.data to conduct network metaregression (see Details). 
cov2 
Optional second covariate in prt.data and std.data to conduct network metaregression (see Details). 
cov3 
Optional third covariate in prt.data and std.data to conduct network metaregression (see Details). 
bias 
Variable with information on risk of bias in prt.data and std.data (can be provided when method.bias = 'adjust1' or 'adjust2'). Possible values of this variable are 'low', 'high' or 'unclear' (can be abbreviated). These values must be identical for all participants from the same study. 
unfav 
Variable in prt.data and std.data indicating the unfavored treatment in each study (can be provided when method.bias = 'adjust1' or 'adjust2'). The entries of this variable are either 0 (unfavored treatment) or 1 (favorable treatment or treatments). Each study should include only one 0 entry. The values need to be repeated for participants who take the same treatment. 
bias.covariate 
Variable in prt.data and std.data used to estimate the probability of bias (can be provided when method.bias = 'adjust1' or 'adjust2'). 
bias.group 
An optional variable in prt.data and std.data that indicates the bias effect in each study (can be provided when method.bias = 'adjust1' or 'adjust2'). The entries of these variables should be either 1 (study has inactive treatment and its estimate should be adjusted for bias effect), 2 (study has only active treatments and its estimate should be adjusted for bias effect (different from inactive bias effect) or 0 (study does not need any bias adjustment). The values need to be repeated for the participants assigned to the same treatment. Default is 1. 
prt.data 
An object of class data.frame containing the individual participant dataset. Each row contains the data of a single participant. The dataset needs to have the following columns: treatment, study identification, outcome (event and nonevent), design. Additional columns might be required for certain analyses. 
std.data 
An object of class data.frame containing the studylevel dataset. Each row represents the information of study arm. The dataset needs to have the following columns: treatment, study identification, outcome (number of events), sample size and design. Additional columns might be required for certain analyses. 
reference 
A character indicating the name of the reference treatment. When the reference is not specified, the first alphabetic treatment will be used as a reference in the analysis. 
trt.effect 
A character defining the model for the studyspecific treatment effects. Options are 'random' (default) or 'common'. 
cov1.ref 
An optional value to center the first covariate which is only useful for a continuous covariate. Dichotomous covariates should be given NA value. The default is the overall minimum covariate value from all studies. 
cov2.ref 
An optional value to center the second covariate which is only useful for a continuous covariate. Dichotomous covariates should be given NA value. The default is the overall minimum covariate value from all studies. 
cov3.ref 
An optional value to center the third covariate which is only useful for a continuous covariate. Dichotomous covariates should be given NA value. The default is the overall minimum covariate value from all studies. 
reg0.effect 
An optional character (needed when at least

regb.effect 
An optional character (needed when at least

regw.effect 
An optional character (needed when at least

split.regcoef 
A logical value (needed when at least

method.bias 
A character for defining the method to combine randomized clinical trials (RCT) and nonrandomized studies (NRS). Options are 'naive' for naive or unadjusted synthesize, 'prior' for using NRS evidence to construct priors for the relative treatment effects in RCTs analysis, or 'adjust1' and 'adjust2' to allow a bias adjustment. When only one design is available (either rct or nrs), this argument needs also to be specified to indicate whether unadjusted (naive) or biasadjusted analysis (adjust1 or adjust2) should be applied. 
bias.type 
An optional character defining of bias on the treatment effect (required when method.bias='adjust1'). Three options are possible: 'add' to add the additive bias effect,'mult' for multiplicative bias effect and 'both' includes both an additive and a multiplicative terms. 
bias.effect 
An optional character indicating the relationship for the bias coefficients across studies. Options are 'random' or 'common' (default). It is required when method.bias='adjust1' or 'adjust2'. 
down.wgt 
An optional numeric indicating the percent to which studies at high risk of bias will be downweighed on average. The value ranges between 0 and 1. It can be provided when method.bias='adjust1' or 'adjust2'. 
prior 
An optional list to control the prior for various parameters in JAGS model. When effects are set as 'random', we can set the heterogeneity parameters for: tau.trt for the treatment effects, tau.reg0 for the effect of prognostic covariates, tau.regb and tau.regw for within and betweenstudy covariate effect, respectively. and tau.gamma for bias effect. The default of all heterogeneity parameters is 'dunif(0,2)'. Currently only the uniform distribution is supported. When the method.bias= 'adjust1' or 'adjust2', the user may provide priors to control the bias probability. For the bias probabilities, beta distributions are assumed with the following default values: RCT with low (pi.low.rct='dbeta(1,10)'), high (pi.high.rct='dbeta(10,1)') bias, NRS with low (pi.low.rct='dbeta(1,30)') / high (pi.high.rct='dbeta(30,1)') bias (pi.low.nrs, pi.high.nrs). 
run.nrs 
An optional list is needed when the NRS used as a
prior (method.bias='prior'). The list consists of the following:
( 
quiet 
A logical passed on to

This function creates a JAGS model and the needed data. The JAGS
code is created from the internal function crossnma.code
.
Covariates provided in arguments cov1
, cov2
and
cov3
can be either numeric or dichotomous (should be
provided as factor or character) variables. By default, no
covariate adjustment is applied (network metaanalysis).
An object of class crossnma.model
containing information on
the JAGS model, which is a list containing the following
components:
model 
A long character string containing JAGS code that
will be run in 
data 
The data to be used to run JAGS model. 
trt.key 
A table of the treatments and its mapped integer number (as used in JAGS model). 
study.key 
A table of the studies and its mapped integer number (as used in JAGS model). 
trt.effect 
A character defining the model for the studyspecific treatment effects. 
method.bias 
A character for defining the method to combine randomized clinical trials (RCT) and nonrandomized studies (NRS). 
covariate 
A vector of the the names of the covariates
( 
cov.ref 
A vector of values of 
dich.cov.labels 
A matrix with the levels of each dichotomous covariate and the corresponding assigned 0 / 1 values. 
split.regcoef 
A logical value. If FALSE the within and betweenstudy regression coefficients will be considered equal. 
regb.effect 
A character indicating the model for the betweenstudy regression coefficients across studies. 
regw.effect 
A character indicating the model for the withinstudy regression coefficients across studies. 
bias.effect 
A character indicating the model for the bias coefficients across studies. 
bias.type 
A character indicating the effect of bias on the treatment effect; additive ('add') or multiplicative ('mult') or both ('both'). 
all.data.ad 
A data.frame object with the prt.data (after it is aggregated) and std.data in a single dataset. 
call 
Function call. 
version 
Version of R package crossnma used to create object. 
Tasnim Hamza tasnim.hamza@ispm.unibe.ch, Guido Schwarzer sc@imbi.unifreiburg.de
# We conduct a network metaanalysis assuming a randomeffects
# model.
# The data comes from randomizedcontrolled trials and
# nonrandomized studies (combined naively)
head(ipddata) # participantlevel data
head(stddata) # studylevel 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)