This function creates a JAGS model and the needed data for cross-design and cross-format network meta-analysis or meta-regression 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
)An object of class crossnma.model containing information on
the JAGS model, which is a list containing the following
components:
A long character string containing JAGS code that
will be run in jags.parallel.
The data to be used to run JAGS model.
A table of the treatments and its mapped integer number (as used in JAGS model).
A table of the studies and its mapped integer number (as used in JAGS model).
A character defining the model for the study-specific treatment effects.
A character for defining the method to analyse combine randomized clinical trials (RCT) or \/ and non-randomized studies (NRS).
A vector of the the names of the covariates
(cov1, cov2 and cov3) in prt.data and std.data used in
network meta-regression.
A vector of values of cov1.ref, cov2.ref,
cov3.ref to center continuous covariates. Dichotomous covariates
take NA.
A matrix with the levels of each dichotomous covariate and the corresponding assigned 0 / 1 values.
A logical value. If FALSE the within- and between-study regression coefficients will be considered equal.
A character indicating the model for the between-study regression coefficients across studies.
A character indicating the model for the within-study regression coefficients across studies.
A character indicating the model for the bias coefficients across studies.
A character indicating the effect of bias on the treatment effect; additive ("add") or multiplicative ("mult") or both ("both").
A data.frame object with the prt.data (after it is aggregated) and std.data in a single dataset.
Function call.
Version of R package crossnma used to create object.
Treatment variable in prt.data and
std.data.
Study variable in prt.data and std.data.
Outcome variable in prt.data and
std.data.
Number of participants in std.data.
Design variable in prt.data and
std.data.
Standard error variable in std.data (required only
for continuous outcome when sm = "MD" or "SMD").
Optional first covariate in prt.data and
std.data to conduct network meta-regression (see Details).
Optional second covariate in prt.data and
std.data to conduct network meta-regression (see Details).
Optional third covariate in prt.data and
std.data to conduct network meta-regression (see Details).
Optional variable with information on risk of bias in
prt.data and std.data. Possible values for this
variable are "low", "high" or "unclear" (can be
abbreviated). These values must be identical for all participants
from the same study. Either this variable or bias.covariate
variable should be provided when method.bias = "adjust1" or
"adjust2".
An optional variable in prt.data and
std.data indicating the unfavored treatment in each study
(should 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.
An optional variable in prt.data and
std.data indicate the covariate used to estimate the
probability of bias. Either this variable or bias variable should
be provided when method.bias = "adjust1" or "adjust2".
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.
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 non-event), design. Additional columns might be required for certain analyses.
An object of class data.frame containing the study-level 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.
A character indicating the underlying summary measure. Options are: Odds Ratio "OR" (default), Risk Ratio "RR", Mean Difference "MD" or Standardised Mean Difference "SMD".
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.
A character defining the model for the study-specific treatment effects. Options are "random" (default) or "common".
The level used to calculate credible intervals for network estimates.
Logical. If TRUE SUCRA (Surface Under the Cumulative Ranking) values will be calculated within JAGS.
A character string specifying whether small
treatment effects indicate a beneficial ("desirable") or
harmful ("undesirable") effect, can be abbreviated. This
argument is required when sucra is TRUE.
The participant covariate value of cov1
for which to report the results. Must be specified for network
meta-regression, sucra is TRUE and when individual
participant dataset is used in the analysis. For dichotomous
covariates, a character of the level (used in the data) should be
indicated.
The participant covariate value of cov2
for which to report the results. Must be specified for network
meta-regression, sucra is TRUE and when individual
participant dataset is used in the analysis. For dichotomous
covariates, a character of the level (used in the data) should be
indicated.
The participant covariate value of cov3
for which to report the results. Must be specified for network
meta-regression, sucra is TRUE and when individual
participant dataset is used in the analysis. For dichotomous
covariates, a character of the level (used in the data) should be
indicated.
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.
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.
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.
An optional character (can by provided when at
least cov1 is not NULL) indicating the relationship across
studies for the prognostic effects expressed by the regression
coefficient, (\(\beta_0\)), in a study \(j\). Options are
"independent" or "random". We recommend using "independent"
(default).
An optional character (can by provided when at
least cov1 is not NULL) indicating the relationship across
treatments for the between-study regression coefficient
(\(\beta^B\)). This parameter quantifies the treatment-mean
covariate interaction. Options are "independent", "random" or
"common". Default is "random".
An optional character (can by provided when at
least cov1 is not NULL) indicating the relationship across
treatments for the within-study regression coefficient
(\(\beta^W\)). This parameter quantifies the
treatment-covariate interaction effect at the individual level.
Options are "independent", "random" and "common". Default is
"random".
A logical value (needed when at least
cov1 is not NULL). If TRUE (default) the within- and
between-study coefficients will be splitted in the analysis of
prt.data. When the split.regcoef = FALSE, only a single
regression coefficient will be estimated to represent both the
between-studies and within-studies covariate effects. In this
case, both arguments regb.effect and regw.effect
need to be given the same option to model the single regression
effect.
A character for defining the method to combine randomized clinical trials (RCT) and non-randomized 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 bias-adjusted analysis (adjust1 or adjust2) should be applied.
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.
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".
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".
Optional string to specify the prior for the between-study heterogeneity in treatment effects in JAGS model (when trt.effect="random"). The default prior is constructed from the data (see Details).
Optional string to specify the prior for the between-study heterogeneity in prognostic effects in JAGS model (when reg0.effect="random"). The default prior is constructed from the data (see Details).
Optional string to specify the prior for the between-study heterogeneity in between-study covariate effects in JAGS model (when regb.effect="random"). The default prior is constructed from the data (see Details).
Optional string to specify the prior for the between-study heterogeneity in within-study covariate effects in JAGS model (when regw.effect="random"). The default prior is constructed from the data (see Details).
Optional string to specify the prior for the between-study heterogeneity in bias effects in JAGS model (when bias.effect="random").
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)".
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)".
Optional string to provide the prior for the bias probability of non-randomised 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)".
Optional string to provide the prior for the bias probability of non-randomised 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)".
Optional numeric controls the common inflation of the variance of NRS estimates (\(w\)) and its values range between 0 (NRS does not contribute at all and the prior is vague) and 1 (the NRS evidence is used at face value, default approach). This argument can be provided when the NRS used as a prior (method.bias = "prior").
Optional numeric controls the bias shift
(\(\zeta\)) to be added / subtracted from the estimated mean
treatment effects (on the log-scale when sm = "OR" or
"RR") from NRS network (0 is the default). This argument
can be provided when the NRS used as a prior (method.bias =
"prior").
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").
Optional numeric specifies the number of iterations for adaptation. This determines how many steps the algorithm takes to adjust its parameters before starting the main sampling process. Default is 1000. This argument can be provided when the NRS used as a prior (method.bias = "prior").
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").
Optional numeric specifies the number of burn-in 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").
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").
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").
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.
Deprecated argument (replaced by
run.nrs.thin).
Tasnim Hamza hamza.a.tasnim@gmail.com, Guido Schwarzer guido.schwarzer@uniklinik-freiburg.de
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 meta-analysis).
The default prior for the between-study 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.
crossnma, jags.parallel
if (FALSE) {
# 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")
# 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)
}
Run the code above in your browser using DataLab