crossnma.model {crossnma}  R Documentation 
This function creates a JAGS model and the needed data for crossdesign and crossformat network metaanalysis or metaregression for different types of outcome
crossnma.model(
trt,
study,
outcome,
n,
design,
se,
cov1 = NULL,
cov2 = NULL,
cov3 = NULL,
bias = NULL,
unfav = NULL,
bias.covariate = NULL,
bias.group = NULL,
prt.data = NULL,
std.data = NULL,
sm,
reference = NULL,
trt.effect = "random",
level.ma = gs("level.ma"),
sucra = FALSE,
small.values = NULL,
cov1.value = NULL,
cov2.value = NULL,
cov3.value = NULL,
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.tau.trt = NULL,
prior.tau.reg0 = NULL,
prior.tau.regb = NULL,
prior.tau.regw = NULL,
prior.tau.bias = NULL,
prior.pi.high.rct = NULL,
prior.pi.low.rct = NULL,
prior.pi.high.nrs = NULL,
prior.pi.low.nrs = NULL,
run.nrs.var.infl = 1,
run.nrs.mean.shift = 0,
run.nrs.trt.effect = "common",
run.nrs.n.adapt = 1000,
run.nrs.n.iter = 10000,
run.nrs.n.burnin = 4000,
run.nrs.thin = 1,
run.nrs.n.chains = 2,
backtransf = gs("backtransf"),
run.nrs.n.thin = NULL
)
trt 
Treatment variable in 
study 
Study variable in 
outcome 
Outcome variable in 
n 
Number of participants in 
design 
Design variable in 
se 
Standard error variable in 
cov1 
Optional first covariate in 
cov2 
Optional second covariate in 
cov3 
Optional third covariate in 
bias 
Optional variable with information on risk of bias in

unfav 
An optional variable in 
bias.covariate 
An optional variable in 
bias.group 
An optional variable in 
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. 
sm 
A character indicating the underlying summary measure. Options are: Odds Ratio "OR" (default), Risk Ratio "RR", Mean Difference "MD" or Standardised Mean Difference "SMD". 
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". 
level.ma 
The level used to calculate credible intervals for network estimates. 
sucra 
Logical. If TRUE SUCRA (Surface Under the Cumulative Ranking) values will be calculated within JAGS. 
small.values 
A character string specifying whether small
treatment effects indicate a beneficial ( 
cov1.value 
The participant covariate value of 
cov2.value 
The participant covariate value of 
cov3.value 
The participant covariate value of 
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 (can by provided when at
least 
regb.effect 
An optional character (can by provided when at
least 
regw.effect 
An optional character (can by provided 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 the relationship between the bias effect and 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 can be provided when method.bias = "adjust1" or "adjust2". 
down.wgt 
An optional numeric indicating the percent to which studies at high risk of bias will be downweighted on average. The value ranges between 0 and 1. It can be provided when method.bias = "adjust1" or "adjust2". 
prior.tau.trt 
Optional string to specify the prior for the betweenstudy heterogeneity in treatment effects in JAGS model (when trt.effect="random"). The default prior is constructed from the data (see Details). 
prior.tau.reg0 
Optional string to specify the prior for the betweenstudy heterogeneity in prognostic effects in JAGS model (when reg0.effect="random"). The default prior is constructed from the data (see Details). 
prior.tau.regb 
Optional string to specify the prior for the betweenstudy heterogeneity in betweenstudy covariate effects in JAGS model (when regb.effect="random"). The default prior is constructed from the data (see Details). 
prior.tau.regw 
Optional string to specify the prior for the betweenstudy heterogeneity in withinstudy covariate effects in JAGS model (when regw.effect="random"). The default prior is constructed from the data (see Details). 
prior.tau.bias 
Optional string to specify the prior for the betweenstudy heterogeneity in bias effects in JAGS model (when bias.effect="random"). 
prior.pi.high.rct 
Optional string to provide the prior for the bias probability of randomised clinical trials (RCT) with high risk of bias in JAGS model (when the method.bias = "adjust1" or "adjust2" and the variable "bias" is provided). The default is the beta distribution "dbeta(10,1)". 
prior.pi.low.rct 
Optional string to provide the prior for the bias probability of randomised clinical trials (RCT) with low risk of bias in JAGS model (when the method.bias = "adjust1" or "adjust2" and the variable "bias" is provided). The default is the beta distribution "dbeta(1,10)". 
prior.pi.high.nrs 
Optional string to provide the prior for the bias probability of nonrandomised studies (NRS) with high risk of bias in JAGS model (when the method.bias = "adjust1" or "adjust2" and the variable "bias" is provided). The default is the beta distribution "dbeta(30,1)". 
prior.pi.low.nrs 
Optional string to provide the prior for the bias probability of nonrandomised studies (NRS) with low risk of bias in JAGS model (when the method.bias = "adjust1" or "adjust2" and the variable "bias" is provided). The default is the beta distribution "dbeta(1,30)". 
run.nrs.var.infl 
Optional numeric controls the common
inflation of the variance of NRS estimates ( 
run.nrs.mean.shift 
Optional numeric controls the bias shift
( 
run.nrs.trt.effect 
Optional character indicates how to combine treatment effects across NRS studies. Options are "random" or "common" (default). This argument can be provided when the NRS used as a prior (method.bias = "prior"). 
run.nrs.n.adapt 
DESCRIBE ARGUMENT. 
run.nrs.n.iter 
Optional numeric specifies the number of iterations to run MCMC chains for NRS network. Default is 10000. This argument can be provided when the NRS used as a prior (method.bias = "prior"). 
run.nrs.n.burnin 
Optional numeric specifies the number of burnin to run MCMC chains for NRS network. Default is 4000. This argument can be provided when the NRS used as a prior (method.bias = "prior"). 
run.nrs.thin 
Optional numeric specifying thinning to run MCMC chains for NRS network. Default is 1. This argument can be provided when the NRS used as a prior (method.bias = "prior"). 
run.nrs.n.chains 
Optional numeric specifies the number of chains to run MCMC chains for NRS network. Default is 2. This argument can be provided when the NRS used as a prior (method.bias = "prior"). 
backtransf 
A logical indicating whether results should be
back transformed in printouts. If 
run.nrs.n.thin 
Deprecated argument (replaced by

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).
The default prior for the betweenstudy heterogeneity parameters (prior.tau.trt, prior.tau.reg0, prior.tau.regb, prior.tau.regw and prior.tau.bias) is a uniform distribution over the range 0 to ML, where ML is the largest maximum likelihood estimates of all relative treatment effects in all studies.
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 analyse combine randomized clinical trials (RCT) or \/ 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 guido.schwarzer@uniklinikfreiburg.de
## Not run:
# We conduct a network metaanalysis assuming a randomeffects
# model.
# The data comes from randomizedcontrolled trials and
# nonrandomized studies (combined naively)
head(ipddata) # participantlevel data
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")
# Print call of JAGS model
mod
# Print JAGS code
summary(mod)
# Fit JAGS model
set.seed(1909)
fit < crossnma(mod)
# Display the output
summary(fit)
plot(fit)
## End(Not run)