Title: | Bayesian Network Meta-Analysis using 'JAGS' |
---|---|
Description: | Network meta-analyses using Bayesian framework following Dias et al. (2013) <DOI:10.1177/0272989X12458724>. Based on the data input, creates prior, model file, and initial values needed to run models in 'rjags'. Able to handle binomial, normal and multinomial arm-level data. Can handle multi-arm trials and includes methods to incorporate covariate and baseline risk effects. Includes standard diagnostics and visualization tools to evaluate the results. |
Authors: | Michael Seo [aut, cre], Christopher Schmid [aut] |
Maintainer: | Michael Seo <[email protected]> |
License: | GPL-3 |
Version: | 1.6.0 |
Built: | 2024-11-07 06:41:22 UTC |
Source: | CRAN |
A package for running Bayesian network meta analysis
Network meta-analysis or mixed treatment comparison (MTC) is a method that allows simultaneous comparison of more than two treatments. We use a Bayesian approach to combine both direct and indirect evidence as in Dias et al. 2013a. This package is a user friendly application that can run network meta analysis models without having to code a JAGS model. The program takes the input data and transforms it to a suitable format of analysis, generates a JAGS model and reasonable initial values and runs the model through the rjags package. The focus of this package was inclusion of multinomial response and various options for adding covariates and/or baseline risks effects. Also, while sampling, the package uses Gelman-Rubin convergence criteria to decide whether to continue sampling or not. Furthermore, package includes different models such as contrast based models and unrelated mean effects (UME) model and nodesplitting model to test for inconsistency.
A.J. Franchini, S. Dias, A.E. Ades, J.P. Jansen, N.J. Welton (2012), Accounting for correlation in network meta-analysis with multi-arm trials, Research Synthesis Methods 3(2):142-160. doi:10.1002/jrsm.1049
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013a), A Generalized Linear Modeling Framework for Pairwise and Network Meta-analysis of Randomized Controlled Trials, Medical Decision Making 33(5):607-617. doi:10.1177/0272989X12458724
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013b), Heterogeneity-Subgroups, Meta-Regression, Bias, and Bias-Adjustment, Medical Decision Making 33(5):618-640. doi:10.1177/0272989X13485157
S. Dias, N.J. Welton, D.M. Caldwellb, A.E. Ades (2010), Checking consistency in mixed treatment, Statistics in Medicine 29(7-8, Sp. Iss. SI): 932-944. doi:10.1002/sim.3767
S. Dias, N.J. Welton, A.J. Sutton, D.M. Caldwell, G. Lu, and A.E. Ades (2013), Evidence synthesis for decision making 4: inconsistency in networks of evidence based on randomized controlled trials, Medical Decision Making 33(5):641-656. doi:10.1177/0272989X12455847
C.H. Schmid, T.A. Trikalinos, I. Olkin (2014), Bayesian network meta-analysis for unordered categorical outcomes with incomplete data, Research Synthesis Methods 5(2):162-185. doi:10.1002/jrsm.1103
A. Gelman, D.B. Rubin (1992), Inference from iterative simulation using multiple sequences, Statistical Science 7(4):457-472. doi:10.1214/ss/1177011136
D.J. Spiegelhalter, N.G. Best, and B.P. Carlin (1998), Bayesian deviance, the effective nunmber of parameters, and the comparison of arbitrarily complex models, Technical report, MRC Biostatistics Unit, Cambridge, UK.
F.A. Achana, N.J. Cooper, S. Dias, G. Lu, S.J.C. Rice, D. Kendrick, A.J. Sutton (2012), Extending methods for investigating the relationship between treatment effect and baseline risk from pairwise meta-analysis to network meta-analysis, Statistics in Medicine 32(5):752-771. doi:10.1002/sim.5539
F.A. Achana, N.J. Cooper, S. Bujkiewicz, S.J. Hubbard, D. Kendrick, D.R. Jones, A.J. Sutton (2014), Network meta-analysis of multiple outcomes measures accounting for borrowing of information across outcomes, BMC Medical Research Methodology 14:92. doi:10.1186/1471-2288-14-92
G. Salanti, A.E. Ades, J.P.A. Ioannidisa (2011), Graphical methods and numerical summaries for presenting results from multiple-treatment meta-analysis: an overview and tutorial, Journal of Clinical Epidemiology 64(2):163-171. doi:10.1016/j.jclinepi.2010.03.016
G. van Valkenhoef, G. Lu, B. de Brock, H. Hillege, A.E. Ades, and N.J. Welton (2012), Automating network meta-analysis, Research Synthesis Methods 3(4):285-299. doi:10.1002/jrsm.1054
N.J. Cooper, A.J. Sutton, D. Morris, A.E. Ades, N.J. Welton (2009), Addressing between-study heterogeneity and inconsistency in mixed treatment comparisons: Application to stroke prevention treatments in individuals with non-rheumatic atrial fibrillation, Statistics in Medicine 28:1861-1881. doi:10.1002/sim.3594
W. Viechtbauer (2010), Conducting meta-analyses in R with the metafor package, Journal of Statistical Software, 36(3):1-48. doi:10.18637/jss.v036.i03
A dataset of 22 trials investigating beta blockers versus control to prevent mortality after myocardial infarction. Control is coded as 1 and beta blocker treatment is coded as 2.
blocker
blocker
A list of Outcomes, Treat, Study, and N.
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013a), A Generalized Linear Modeling Framework for Pairwise and Network Meta-analysis of Randomized Controlled Trials, Medical Decision Making 33(5):607-617. doi:10.1177/0272989X12458724
Calculates deviance statistics. This function automatically called in contrast.network.run
and the deviance statistics are stored after sampling is finished.
calculate.contrast.deviance(result)
calculate.contrast.deviance(result)
result |
Object created by |
Dbar |
Overall residual deviance |
pD |
Sum of leverage_arm (i.e. total leverage) |
DIC |
Deviance information criteria (sum of Dbar and pD) |
resdev_study |
Posterior mean of the residual deviance in each study |
devtilda_study |
Deviance at the posterior mean of the fitted values |
leverage_study |
Difference between resdev_study and devtilda_study for each trial |
A.J. Franchini, S. Dias, A.E. Ades, J.P. Jansen, N.J. Welton (2012), Accounting for correlation in network meta-analysis with multi-arm trials, Research Synthesis Methods 3(2):142-160. doi:10.1002/jrsm.1049
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013a), A Generalized Linear Modeling Framework for Pairwise and Network Meta-analysis of Randomized Controlled Trials, Medical Decision Making 33(5):607-617. doi:10.1177/0272989X12458724
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) }) result <- contrast.network.run(network) calculate.contrast.deviance(result)
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) }) result <- contrast.network.run(network) calculate.contrast.deviance(result)
Calculates deviance statistics. This function automatically called in network.run
and the deviance statistics are stored after sampling is finished.
calculate.deviance(result)
calculate.deviance(result)
result |
Object created by |
Dbar |
Overall residual deviance |
pD |
Sum of leverage_arm (i.e. total leverage) |
DIC |
Deviance information criteria (sum of Dbar and pD) |
data.points |
Total number of arms in the meta analysis |
dev_arm |
Posterior mean of the residual deviance in each trial arm |
devtilda_arm |
Deviance at the posterior mean of the fitted values |
leverage_arm |
Difference between dev_arm and devtilda_arm for each trial |
rtilda_arm |
Posterior mean of the fitted value for binomial and multinomial |
ybar_arm |
Posterior mean of the fitted value for normal |
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013a), A Generalized Linear Modeling Framework for Pairwise and Network Meta-analysis of Randomized Controlled Trials, Medical Decision Making 33(5):607-617. doi:10.1177/0272989X12458724
#parkinsons network <- with(parkinsons, { network.data(Outcomes, Study, Treat, SE = SE, response = "normal") }) result <- network.run(network) calculate.deviance(result)
#parkinsons network <- with(parkinsons, { network.data(Outcomes, Study, Treat, SE = SE, response = "normal") }) result <- network.run(network) calculate.deviance(result)
A dataset of 17 studies investigating dosage of statin for cardiovascular disease. There are two treatments and a placebo. High dose statin is coded as 3, low dose statin as 2, and placebo is coded as 1 and treated as a baseline treatment. Outcomes are reported as three mutually exclusive unordered outcomes. First column of the outcome is the patients who are still alive (ALIVE). Second column is fatal non-cardiovascular disease (FnCVD). And, the last column is fatal cardiovascular disease (FCVD).
cardiovascular
cardiovascular
A list of Outcomes, Treat, Study, and N
C.H. Schmid, T.A. Trikalinos, I. Olkin (2014), Bayesian network meta-analysis for unordered categorical outcomes with incomplete data, Research Synthesis Methods 5(2):162-185. doi:10.1002/jrsm.1103
A dataset of 12 trials for investigating CZP for the treatment for those who had failed on disease-modifying antirheumatic drugs, including methotrexate (MTX). Data provides the number of patients who have improved and there are 6 different treatments with placebo. Mean disease duration (years) is provided as a covariate.
certolizumab
certolizumab
A list of Outcomes, Treat, Study, N, covariate, and Treat.order
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013b), Heterogeneity-Subgroups, Meta-Regression, Bias, and Bias-Adjustment, Medical Decision Making 33(5):618-640. doi:10.1177/0272989X13485157
This is similar to the function network.data
, except it uses contrast-level data instead of arms-level data. Contrast-level format uses treatment differences relative to the control arm.
Note that in two arm trials there is only one contrast value per trial, but in three arm trials there are two contrast values relative to the control arm.
contrast.network.data( Outcomes, Treat, SE, na, V = NULL, type = "random", rank.preference = "higher", mean.d = 0, prec.d = 1e-04, hy.prior = list("dunif", 0, 100) )
contrast.network.data( Outcomes, Treat, SE, na, V = NULL, type = "random", rank.preference = "higher", mean.d = 0, prec.d = 1e-04, hy.prior = list("dunif", 0, 100) )
Outcomes |
A vector of Contrast-level outcomes. Outcome is assumed to be normally distributed. If there are three arms in a trial, need to include two contrast values for that trial. See parkinsons_contrast data for an example. |
Treat |
A vector of treatments for each arm. Treatments should have positive integer values starting from 1 to total number of treatments. |
SE |
A vector of standard error for each contrasts. |
na |
A vector of number of arms in each study. |
V |
Needed if you have multi-arm trials. Length of this vector should be number of studies. If the study is multi-arm trial, need to specify variance of the baseline treatment in that trial. Denote it with NA if the study only has two-arm trials. |
type |
Type of model fitted: either "random" for random effects model or "fixed" for fixed effects model. Default is "random". |
rank.preference |
Set it equal to "higher" if higher values are preferred (i.e. assumes events are good). Set it equal to "lower" if lower values are preferred (i.e. assumes events are bad). Default is "higher". |
mean.d |
Prior mean for the relative effect |
prec.d |
Prior precision for the relative effect |
hy.prior |
Prior for the heterogeneity parameter. Supports uniform, gamma, and half normal for normal. It should be a list of length 3, where first element should be the distribution (one of dunif, dgamma, dhnorm, dwish) and the next two are the parameters associated with the distribution. For example, list("dunif", 0, 5) give uniform prior with lower bound 0 and upper bound 5 for the heterogeneity parameter. |
Creates list of variables that are used to run the model using contrast.network.run
A.J. Franchini, S. Dias, A.E. Ades, J.P. Jansen, N.J. Welton (2012), Accounting for correlation in network meta-analysis with multi-arm trials, Research Synthesis Methods 3(2):142-160. doi:10.1002/jrsm.1049
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013a), A Generalized Linear Modeling Framework for Pairwise and Network Meta-analysis of Randomized Controlled Trials, Medical Decision Making 33(5):607-617. doi:10.1177/0272989X12458724
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) })
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) })
This makes a contrasrt network deviance plot which plots residual deviance (resdev_study) vs. all study.
contrast.network.deviance.plot(result)
contrast.network.deviance.plot(result)
result |
Object created by |
None
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) }) result <- contrast.network.run(network) contrast.network.deviance.plot(result)
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) }) result <- contrast.network.run(network) contrast.network.deviance.plot(result)
This function makes a leverage vs. square root of residual deviance plot
contrast.network.leverage.plot(result)
contrast.network.leverage.plot(result)
result |
Object created by |
None
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) }) result <- contrast.network.run(network) contrast.network.leverage.plot(result)
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) }) result <- contrast.network.run(network) contrast.network.leverage.plot(result)
This is similar to the function network.run
, except it uses contrast-level data instead of arms-level data.
contrast.network.run( network, inits = NULL, n.chains = 3, max.run = 1e+05, setsize = 10000, n.run = 50000, conv.limit = 1.05, extra.pars.save = NULL )
contrast.network.run( network, inits = NULL, n.chains = 3, max.run = 1e+05, setsize = 10000, n.run = 50000, conv.limit = 1.05, extra.pars.save = NULL )
network |
contrast level network object created from |
inits |
Initial values for the parameters being sampled. If left unspecified, program will generate reasonable initial values. |
n.chains |
Number of chains to run |
max.run |
Maximum number of iterations that user is willing to run. If the algorithm is not converging, it will run up to |
setsize |
Number of iterations that are run between convergence checks. If the algorithm converges fast, user wouldn't need a big setsize. The number that is printed between each convergence checks is the gelman-rubin diagnostics and we would want that to be below the conv.limit the user specifies. |
n.run |
Final number of iterations that the user wants to store. If after the algorithm converges, user wants less number of iterations, we thin the sequence. If the user wants more iterations, we run extra iterations to reach the specified number of runs |
conv.limit |
Convergence limit for Gelman and Rubin's convergence diagnostic. Point estimate is used to test convergence of parameters for study effect (eta), relative effect (d), and heterogeneity (log variance (logvar)). |
extra.pars.save |
Parameters that user wants to save besides the default parameters saved. See code using |
data_rjags |
Data that is put into rjags function jags.model |
inits |
Initial values that are either specified by the user or generated as a default |
pars.save |
Parameters that are saved. Add more parameters in extra.pars.save if other variables are desired |
burnin |
Half of the converged sequence is thrown out as a burnin |
n.thin |
If the number of iterations user wants (n.run) is less than the number of converged sequence after burnin, we thin the sequence and store the thinning interval |
samples |
MCMC samples stored using jags. The returned samples have the form of mcmc.list and can be directly applied to coda functions |
max.gelman |
Maximum Gelman and Rubin's convergence diagnostic calculated for the final sample |
deviance |
Contains deviance statistics such as pD (effective number of parameters) and DIC (Deviance Information Criterion) |
rank.tx |
Rank probability calculated for each treatments. |
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) }) result <- contrast.network.run(network)
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) }) result <- contrast.network.run(network)
This function draws network graph using igraph package
draw.network.graph(network, label.dist = 2)
draw.network.graph(network, label.dist = 2)
network |
Object created by |
label.dist |
distance of the label from the node. Default is 2. |
None
#cardiovascular network <- with(thrombolytic, { network.data(Outcomes, Study, Treat, N=N, response = "binomial") }) draw.network.graph(network)
#cardiovascular network <- with(thrombolytic, { network.data(Outcomes, Study, Treat, N=N, response = "binomial") }) draw.network.graph(network)
This function generates autocorrelation diagnostics using coda package. User can specify lags and parameters to display.
Note that to display extra parameters that are not saved, user needs to first specify parameters in extra.pars.save
parameter in network.run
function.
network.autocorr.diag( result, lags = c(0, 1, 5, 10, 50), extra.pars = NULL, only.pars = NULL )
network.autocorr.diag( result, lags = c(0, 1, 5, 10, 50), extra.pars = NULL, only.pars = NULL )
result |
Object created by |
lags |
A vector of lags at which to calculate the autocorrelation |
extra.pars |
Extra parameters that the user wants to display other than the default parameters. |
only.pars |
Parameters that user wants to display. This gets rids of other default parameters user doesn't want to show. |
Returns autocorrelation diagnostics
network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) network.autocorr.diag(result, only.pars = "d")
network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) network.autocorr.diag(result, only.pars = "d")
This function plots autocorrelation using coda package.
network.autocorr.plot(result, extra.pars = NULL, only.pars = NULL)
network.autocorr.plot(result, extra.pars = NULL, only.pars = NULL)
result |
Object created by |
extra.pars |
Extra parameters that the user wants to plot other than the default parameters. |
only.pars |
Parameters that user wants to display. This gets rids of other default parameters user doesn't want to show |
None
network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) network.autocorr.plot(result)
network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) network.autocorr.plot(result)
This function makes a covariate plot of how the relative effect changes as the covariate value changes.
User needs to specify one base treatment and one comparison treatment to make this plot (base category and comparison category is also needed for multinomial).
The function uses the relative.effects
to calculate the correct relative effect. 2.5%, median, and 97.5% C.I. are drawn.
network.covariate.plot( result, base.treatment = NULL, comparison.treatment = NULL, base.category = NULL, comparison.category = NULL, covariate.name = NULL )
network.covariate.plot( result, base.treatment = NULL, comparison.treatment = NULL, base.category = NULL, comparison.category = NULL, covariate.name = NULL )
result |
Object created by |
base.treatment |
Base treatment for relative effect |
comparison.treatment |
Treatment comparing against base treatment |
base.category |
Base category for multinomial data. Note that category in multinomial denotes which column it is in the Outcomes matrix. Thus, this should be a numeric value. |
comparison.category |
Comparison category for multinomial data |
covariate.name |
A vector of covariate names of the covariate that goes into x-axis label |
None
########### certolizumab (with covariate) network <- with(certolizumab, { network.data(Outcomes, Study, Treat, N=N, response="binomial", Treat.order, covariate = covariate, covariate.type = "continuous", hy.prior = list("dhnorm", 0, 9.77)) }) result <- network.run(network) network.covariate.plot(result, base.treatment = "Placebo", comparison.treatment = "CZP", covariate.name = "Disease Duration")
########### certolizumab (with covariate) network <- with(certolizumab, { network.data(Outcomes, Study, Treat, N=N, response="binomial", Treat.order, covariate = covariate, covariate.type = "continuous", hy.prior = list("dhnorm", 0, 9.77)) }) result <- network.run(network) network.covariate.plot(result, base.treatment = "Placebo", comparison.treatment = "CZP", covariate.name = "Disease Duration")
This function creates a treatment cumulative rank plot. Rank preference can be specified by the rank.preference
parameter in network.data
network.cumrank.tx.plot( result, txnames = NULL, catnames = NULL, legend.position = c(1, 1) )
network.cumrank.tx.plot( result, txnames = NULL, catnames = NULL, legend.position = c(1, 1) )
result |
Object created by |
txnames |
Treatment names used in creating legend |
catnames |
Category names. Only used in multinomial. |
legend.position |
x, y position of the legend |
None
network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) network.cumrank.tx.plot(result, txnames = c("control", "beta blocker"))
network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) network.cumrank.tx.plot(result, txnames = c("control", "beta blocker"))
This function makes a network object that can be used to run network meta-analysis using network.run
.
User needs to specify Outcomes, Study, Treat, N or SE, and response.
Prior parameters are filled in automatically based on the data type if not specified.
The input data should be arm-level so that we have observations for each treatment in each study.
The input data is preprocessed to fit the format necessary to run model in JAGS.
network.data( Outcomes = NULL, Study = NULL, Treat = NULL, N = NULL, SE = NULL, response = NULL, Treat.order = NULL, type = "random", rank.preference = "higher", baseline = "none", baseline.risk = "independent", covariate = NULL, covariate.type = NULL, covariate.model = NULL, mean.d = NULL, prec.d = NULL, mean.Eta = NULL, prec.Eta = NULL, hy.prior.Eta = NULL, mean.bl = NULL, prec.bl = NULL, hy.prior.bl = NULL, mean.cov = NULL, prec.cov = NULL, hy.prior.cov = NULL, hy.prior = NULL, mean.A = NULL, prec.A = NULL, Z = NULL, Z_bl = NULL )
network.data( Outcomes = NULL, Study = NULL, Treat = NULL, N = NULL, SE = NULL, response = NULL, Treat.order = NULL, type = "random", rank.preference = "higher", baseline = "none", baseline.risk = "independent", covariate = NULL, covariate.type = NULL, covariate.model = NULL, mean.d = NULL, prec.d = NULL, mean.Eta = NULL, prec.Eta = NULL, hy.prior.Eta = NULL, mean.bl = NULL, prec.bl = NULL, hy.prior.bl = NULL, mean.cov = NULL, prec.cov = NULL, hy.prior.cov = NULL, hy.prior = NULL, mean.A = NULL, prec.A = NULL, Z = NULL, Z_bl = NULL )
Outcomes |
Arm-level outcomes. If it is a multinomial response, the matrix would have dimensions treatment arms (row) by multinomial categories (column). If it is binomial or normal, it would be a vector. |
Study |
A vector of study indicator for each arm |
Treat |
A vector of treatment indicator for each arm |
N |
A vector of total number of observations in each arm. Used for binomial and multinomial responses. |
SE |
A vector of standard error for each arm. Used only for normal response. |
response |
Specification of the outcomes type. Must specify one of the following: "normal", "binomial", or "multinomial". |
Treat.order |
Treatment order which determines how treatments are compared. The first treatment that is specified is considered to be the baseline treatment. Default order is alphabetical. If the treatments are coded 1, 2, etc, then the treatment with a value of 1 would be assigned as a baseline treatment. |
type |
Type of model fitted: either "random" for random effects model or "fixed" for fixed effects model. Default is "random". |
rank.preference |
Set it equal to "higher" if higher values are preferred (i.e. assumes events are good). Set it equal to "lower" if lower values are preferred (i.e. assumes events are bad). Default is "higher". |
baseline |
Three different assumptions for treatment x baseline risk interactions (slopes): "independent", "common", or "exchangeable". Default is "none" which doesn't incorporate baseline risk. |
baseline.risk |
Two different assumptions for baseline risk: "independent" or "exchangeable". See Achana et al. (2012) for more information about baseline risk. |
covariate |
A covariate matrix with each row representing each trial and column representing each covariate. This is a study-level data, meaning that the user doesn't need to repeatedly specify covariates for each arm. |
covariate.type |
Should be a vector indicating the type of the covariate. Covariate can be either "continuous" or "discrete". If it continuous, covariates are centered. If the covariate is discrete it is not centered and it has to be in a dummy integer format (i.e. 0,1,2,...). The code doesn't factor the covariates for the user, so user needs to specify dummy variables if factor is needed. |
covariate.model |
"independent" allows covariate effects for each treatment. "common" restricts same covariate effect for all treatment. Lastly, "exchangeable" assumes that the covariate effects are different but related and strength is borrowed across them. We set "common" to be default. See Cooper et al. (2009) for more details on covariates. |
mean.d |
Prior mean for the relative effect |
prec.d |
Prior precision for the relative effect |
mean.Eta |
Prior mean for the study effect (baseline risk) |
prec.Eta |
Prior precision for the study effect (baseline risk) |
hy.prior.Eta |
Between treatment heterogeneity in baseline risk (for exchangeable assumption only). Format of the parameter is same as hy.prior. |
mean.bl |
Prior mean for the baseline slope |
prec.bl |
Prior precision for the baseline slope |
hy.prior.bl |
Between treatment heterogeneity in baseline slope (for exchangeable regression coefficient only). Format of the parameter is same as hy.prior. |
mean.cov |
Prior mean for the covariate effect |
prec.cov |
Prior precision for the covariate effect |
hy.prior.cov |
Between treatment heterogeneity in covariate effect (for exchangeable regression coefficient only). Format of the parameter is same as hy.prior. Default is set to be dunif(0, 5) for binary, dunif(0, 100) for normal, and wishart with identity scale matrix and (# of categories - 1) degrees of freedom for multinomial. |
hy.prior |
Prior for the heterogeneity parameter. Supports uniform, gamma, and half normal for normal and binomial response and wishart for multinomial response. It should be a list of length 3, where first element should be the distribution (one of dunif, dgamma, dhnorm, dwish) and the next two are the parameters associated with the distribution. For example, list("dunif", 0, 5) give uniform prior with lower bound 0 and upper bound 5 for the heterogeneity parameter. For wishart distribution, the last two parameter would be the scale matrix and the degrees of freedom. |
mean.A |
Mean effect of 'standard' treatment (i.e. placebo). It is in logit scale for binomial and continuous scale for normal. For binomial outcome, this additional input is used to calculate the risk difference, relative risk, or number needed to treat. This should be informed from external evidence or can be found by meta-analyzing single proportions. For number needed to treat, we assume that events are "good". Reversal of sign is needed if the events are "bad". |
prec.A |
Precision of 'standard' treatment. Similarly, it is in logit scale for binomial and continuous scale for normal. |
Z |
When calculating treatment effect on the natural scale, this is a scalar or a vector of covariates value(s) that you want to calculate treatment effect at. |
Z_bl |
When calculating treatment effect on the natural scale, this is a scalar of baseline risk (Eta) that you want to calculate treatment effect at. |
Creates list of variables that are used to run the model using network.run
data |
Data combining all the input data. User can check this to insure the data is correctly specified. For modelling purposes, character valued studies or treatment variables are changed to numeric values based on alphabetical order. |
nrow |
Total number of arms in the meta-analysis |
ncat |
Number of columns in the Outcomes. Will equal 1 for binary and normal and number of categories for multinomial |
nstudy |
Number of study |
na |
Number of arms for each study |
ntreat |
Number of treatment |
b.id |
Indicator in sequence of all treatments for which treatment is base treatment in Study |
t |
|
r |
|
mx |
If the continuous covariate is included, it calculates the mean of the covariates which is used to center the covariates. The numeric indicator after mx refers to column number of the covariates if there are more than one covariates included. Discrete covariates are not centered. |
mx_bl |
If the baseline effect is specified, it also calculates the mean baseline risk. |
prior.data |
Prior data created using the user inputs or default values. If no user input is specifies for the prior, it uses default values. |
code |
Rjags model file code that is generated using information provided by the user. To view model file inside R in a nice format, use |
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013a), A Generalized Linear Modeling Framework for Pairwise and Network Meta-analysis of Randomized Controlled Trials, Medical Decision Making 33(5):607-617. doi:10.1177/0272989X12458724
F.A. Achana, N.J. Cooper, S. Dias, G. Lu, S.J.C. Rice, D. Kendrick, A.J. Sutton (2012), Extending methods for investigating the relationship between treatment effect and baseline risk from pairwise meta-analysis to network meta-analysis, Statistics in Medicine 32(5):752-771. doi:10.1002/sim.5539
N.J. Cooper, A.J. Sutton, D. Morris, A.E. Ades, N.J. Welton (2009), Addressing between-study heterogeneity and inconsistency in mixed treatment comparisons: Application to stroke prevention treatments in individuals with non-rheumatic atrial fibrillation, Statistics in Medicine 28:1861-1881. doi:10.1002/sim.3594
###Blocker data example blocker network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) network
###Blocker data example blocker network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) network
This makes a deviance plot which plots residual deviance (dev_arm) vs. all the arms for each study.
network.deviance.plot(result)
network.deviance.plot(result)
result |
Object created by |
None
network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) network.deviance.plot(result)
network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) network.deviance.plot(result)
Draws forest plot of pooled treatment effect. Reports odds ratio for binomial and multinomial outcomes and continuous scale for normal outcomes.
network.forest.plot( result, level = 0.95, ticks.position = NULL, label.multiplier = 0.2, label.margin = 10, title = "Network Meta-analysis Forest plot", only.reference.treatment = FALSE )
network.forest.plot( result, level = 0.95, ticks.position = NULL, label.multiplier = 0.2, label.margin = 10, title = "Network Meta-analysis Forest plot", only.reference.treatment = FALSE )
result |
Object created by |
level |
Confidence level. Default is 0.95 denoting 95 percent C.I. |
ticks.position |
Position of the x-axis tick marks. If left unspecified, the function tries to set it at sensible values |
label.multiplier |
This is a multiplying factor to move the position of the text associated with median[lower, upper] values. This number is multiplied by the range of x-axis and added to the x-axis limit. Default multiplier is set to 0.2. |
label.margin |
This is how much margin space you specify to assign space for the median[lower, upper] values. Default margin is set to 10. |
title |
Header name which you can modify |
only.reference.treatment |
Indicator for plotting only the comparison to the reference treatment |
None
W. Viechtbauer (2010), Conducting meta-analyses in R with the metafor package, Journal of Statistical Software, 36(3):1-48. doi:10.18637/jss.v036.i03
network <- with(certolizumab, { network.data(Outcomes, Study, Treat, N=N, response="binomial", Treat.order, covariate = covariate, covariate.type = "continuous", hy.prior = list("dhnorm", 0, 9.77)) }) result <- network.run(network) network.forest.plot(result)
network <- with(certolizumab, { network.data(Outcomes, Study, Treat, N=N, response="binomial", Treat.order, covariate = covariate, covariate.type = "continuous", hy.prior = list("dhnorm", 0, 9.77)) }) result <- network.run(network) network.forest.plot(result)
This function uses coda package to find Gelman-Rubin diagnostics.
network.gelman.diag(result, extra.pars = NULL, only.pars = NULL)
network.gelman.diag(result, extra.pars = NULL, only.pars = NULL)
result |
Object created by |
extra.pars |
Extra parameters that the user wants to display other than the default parameters. |
only.pars |
Parameters that user wants to display. This gets rids of other default parameters user doesn't want to show. |
Returns gelman-rubin diagnostics
network <- with(statins, { network.data(Outcomes, Study, Treat, N = N, response = "binomial", Treat.order = c("Placebo", "Statin"), covariate = covariate, covariate.type = "discrete") }) result <- network.run(network) network.gelman.diag(result, extra.pars = c("Eta"))
network <- with(statins, { network.data(Outcomes, Study, Treat, N = N, response = "binomial", Treat.order = c("Placebo", "Statin"), covariate = covariate, covariate.type = "discrete") }) result <- network.run(network) network.gelman.diag(result, extra.pars = c("Eta"))
This function plots Gelman-Rubin diagnostic using coda package.
network.gelman.plot(result, extra.pars = NULL, only.pars = NULL)
network.gelman.plot(result, extra.pars = NULL, only.pars = NULL)
result |
Object created by |
extra.pars |
Extra parameters that the user wants to plot other than the default parameters. |
only.pars |
Parameters that user wants to display. This gets rids of other default parameters user doesn't want to show. |
None
network <- with(statins, { network.data(Outcomes, Study, Treat, N = N, response = "binomial", Treat.order = c("Placebo", "Statin"), covariate = covariate, covariate.type = "discrete") }) result <- network.run(network) network.gelman.plot(result)
network <- with(statins, { network.data(Outcomes, Study, Treat, N = N, response = "binomial", Treat.order = c("Placebo", "Statin"), covariate = covariate, covariate.type = "discrete") }) result <- network.run(network) network.gelman.plot(result)
This function compares posterior mean deviance of inconsistency model and consistency model. Such comparison provides information that can help identify the loops in which inconsistency is present.
network.inconsistency.plot(result1, result2, with.label = T)
network.inconsistency.plot(result1, result2, with.label = T)
result1 |
consistency model result from running |
result2 |
inconsistency model result from running |
with.label |
indicator to show the study number; default is true. |
This function draws network graph using igraph package
None
S. Dias, N.J. Welton, A.J. Sutton, D.M. Caldwell, G. Lu, and A.E. Ades (2013), Evidence synthesis for decision making 4: inconsistency in networks of evidence based on randomized controlled trials, Medical Decision Making 33(5):641-656. doi:10.1177/0272989X12455847
network1 <- with(smoking, { network.data(Outcomes, Study, Treat, N = N, response = "binomial", type = "random") }) network2 <- with(smoking, { ume.network.data(Outcomes, Study, Treat, N = N, response = "binomial", type = "random") }) result1 <- network.run(network1) result2 <- ume.network.run(network2) network.inconsistency.plot(result1, result2)
network1 <- with(smoking, { network.data(Outcomes, Study, Treat, N = N, response = "binomial", type = "random") }) network2 <- with(smoking, { ume.network.data(Outcomes, Study, Treat, N = N, response = "binomial", type = "random") }) result1 <- network.run(network1) result2 <- ume.network.run(network2) network.inconsistency.plot(result1, result2)
This function makes a leverage vs. square root of residual deviance plot (mean for each study)
network.leverage.plot(result, per.study = FALSE)
network.leverage.plot(result, per.study = FALSE)
result |
Object created by |
per.study |
Indicator for using an average square root of residual deviance for each study instead of for each arm. Default is FALSE. |
None
network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) network.leverage.plot(result)
network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) network.leverage.plot(result)
This plot displays how each treatment is ranked. For each rank, we show how likely each treatment will be at that rank.
network.rank.tx.plot( result, txnames = NULL, catnames = NULL, legend.position = c(1, 1) )
network.rank.tx.plot( result, txnames = NULL, catnames = NULL, legend.position = c(1, 1) )
result |
Object created by |
txnames |
Treatment names used in creating legend |
catnames |
Category names. Only used in multinomial. |
legend.position |
x,y position of the legend |
None
network <-with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) network.rank.tx.plot(result, txnames = c("a", "b"))
network <-with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) network.rank.tx.plot(result, txnames = c("a", "b"))
This is the core function that runs the model in our program. Before running this function, we need to specify data, prior, JAGS code, etc. using network.data
.
network.run( network, inits = NULL, RNG.inits = NULL, n.chains = 3, max.run = 1e+05, setsize = 10000, n.run = 50000, conv.limit = 1.05, extra.pars.save = NULL )
network.run( network, inits = NULL, RNG.inits = NULL, n.chains = 3, max.run = 1e+05, setsize = 10000, n.run = 50000, conv.limit = 1.05, extra.pars.save = NULL )
network |
Network object created from |
inits |
Initial values for the parameters being sampled. If left unspecified, program will generate reasonable initial values. |
RNG.inits |
List of .RNG.name and .RNG.seed that control the JAGS RNGs. Please refer to jags.model function in rjags for more information. |
n.chains |
Number of chains to run |
max.run |
Maximum number of iterations that user is willing to run. If the algorithm is not converging, it will run up to |
setsize |
Number of iterations that are run between convergence checks. If the algorithm converges fast, user wouldn't need a big setsize. The number that is printed between each convergence checks is the gelman-rubin diagnostics and we would want that to be below the conv.limit the user specifies. |
n.run |
Final number of iterations that the user wants to store. If after the algorithm converges, user wants less number of iterations, we thin the sequence. If the user wants more iterations, we run extra iterations to reach the specified number of runs |
conv.limit |
Convergence limit for Gelman and Rubin's convergence diagnostic. Point estimate is used (instead of 95 percent C.I.) to test convergence of parameters for study-specific baselines (eta), average treatment effect (d), between-study heterogeneity (log variance (logvar)), and regression parameters when covariates (beta) or baseline risk (b_bl). |
extra.pars.save |
Parameters that user wants to save besides the default parameters saved. See code using |
data_rjags |
Data that is put into rjags function |
inits |
Initial values that are either specified by the user or generated as a default |
RNG.inits |
List of .RNG.name and .RNG.seed used for reproducibility |
pars.save |
Parameters that are saved. Add more parameters in extra.pars.save if other variables are desired |
burnin |
Half of the converged sequence is thrown out as a burnin |
n.thin |
If the number of iterations user wants (n.run) is less than the number of converged sequence after burnin, we thin the sequence and store the thinning interval |
samples |
MCMC samples stored using jags. The returned samples have the form of mcmc.list and can be directly applied to coda functions |
max.gelman |
Maximum Gelman and Rubin's convergence diagnostic calculated for the final sample |
conv.save |
Variables that were tested for convergence using Gelman and Rubin's diagnostic |
deviance |
Contains deviance statistics such as pD (effective number of parameters) and DIC (Deviance Information Criterion) |
rank.tx |
Rank probability calculated for each treatments. |
#parkinson's example (normal) network <- with(parkinsons,{ network.data(Outcomes, Study, Treat, SE = SE, response = "normal") }) result <- network.run(network)
#parkinson's example (normal) network <- with(parkinsons,{ network.data(Outcomes, Study, Treat, SE = SE, response = "normal") }) result <- network.run(network)
This function makes a network object that can be used to run network meta-analysis using nodesplit.network.run
.
User needs to specify Outcomes, Study, Treat, N or SE, and response.
Prior parameters are filled in automatically based on the data type if not specified.
The input data should be arm-level so that we have observations for each treatment in each study.
The input data is preprocessed to fit the format necessary to run model in JAGS.
nodesplit.network.data( Outcomes = NULL, Study = NULL, Treat = NULL, N = NULL, SE = NULL, response = NULL, Treat.order = NULL, pair = NULL, type = "random", dic = FALSE )
nodesplit.network.data( Outcomes = NULL, Study = NULL, Treat = NULL, N = NULL, SE = NULL, response = NULL, Treat.order = NULL, pair = NULL, type = "random", dic = FALSE )
Outcomes |
Arm-level outcomes. If it is a multinomial response, the matrix would have dimensions treatment arms (row) by multinomial categories (column). If it is binomial or normal, it would be a vector. |
Study |
A vector of study indicator for each arm |
Treat |
A vector of treatment indicator for each arm |
N |
A vector of total number of observations in each arm. Used for binomial and multinomial responses |
SE |
A vector of standard error for each arm. Used only for normal response |
response |
Specification of the outcomes type. Must specify one of the following: "normal", "binomial", or "multinomial" |
Treat.order |
Treatment order which determines how treatments are compared. The first treatment that is specified is considered to be the baseline treatment. Default order is alphabetical. If the treatments are coded 1, 2, etc, then the treatment with a value of 1 would be assigned as a baseline treatment. |
pair |
Define a pair to split. It has to be a vector of length 2 with treatment names |
type |
Type of model fitted: either "random" for random effects model or "fixed" for fixed effects model. Default is "random". |
dic |
This is an indicator for whether user wants to calculate DIC. Model stores less information if you set it to FALSE. Default is set to FALSE. |
Creates list of variables that are used to run the model using nodesplit.network.run
data |
Data combining all the input data. User can check this to insure the data is correctly specified. For modelling purposes, character valued studies or treatment variables are changed to numeric values based on alphabetical order. |
nrow |
Total number of arms in the meta-analysis |
ncat |
Number of columns in the Outcomes. Will equal 1 for binary and normal and number of categories for multinomial |
nstudy |
Number of study |
na |
Number of arms for each study |
ntreat |
Number of treatment |
b.id |
Indicator in sequence of all treatments for which treatment is base treatment in Study |
t |
|
r |
|
code |
Rjags model file code that is generated using information provided by the user. To view model file inside R in a nice format, use |
S. Dias, N.J. Welton, D.M. Caldwellb, A.E. Ades (2010), Checking consistency in mixed treatment, Statistics in Medicine 29(7-8, Sp. Iss. SI): 932-944. doi:10.1002/sim.3767
###Thrombolytic data example network <- with(thrombolytic,{ nodesplit.network.data(Outcomes, Study, Treat, N, response = "binomial", pair = c(3,9)) }) network
###Thrombolytic data example network <- with(thrombolytic,{ nodesplit.network.data(Outcomes, Study, Treat, N, response = "binomial", pair = c(3,9)) }) network
This is similar to the function network.run
, except this is used for the nodesplitting model.
nodesplit.network.run( network, inits = NULL, n.chains = 3, max.run = 1e+05, setsize = 10000, n.run = 50000, conv.limit = 1.05, extra.pars.save = NULL )
nodesplit.network.run( network, inits = NULL, n.chains = 3, max.run = 1e+05, setsize = 10000, n.run = 50000, conv.limit = 1.05, extra.pars.save = NULL )
network |
network object created from |
inits |
Initial values for the parameters being sampled. If left unspecified, program will generate reasonable initial values. |
n.chains |
Number of chains to run |
max.run |
Maximum number of iterations that user is willing to run. If the algorithm is not converging, it will run up to |
setsize |
Number of iterations that are run between convergence checks. If the algorithm converges fast, user wouldn't need a big setsize. The number that is printed between each convergence checks is the gelman-rubin diagnostics and we would want that to be below the conv.limit the user specifies. |
n.run |
Final number of iterations that the user wants to store. If after the algorithm converges, user wants less number of iterations, we thin the sequence. If the user wants more iterations, we run extra iterations to reach the specified number of runs |
conv.limit |
Convergence limit for Gelman and Rubin's convergence diagnostic. Point estimate is used to test convergence of parameters for study effect (eta), relative effect (d), and heterogeneity (log variance (logvar)). |
extra.pars.save |
Parameters that user wants to save besides the default parameters saved. See code using |
data_rjags |
Data that is put into rjags function jags.model |
inits |
Initial values that are either specified by the user or generated as a default |
pars.save |
Parameters that are saved. Add more parameters in extra.pars.save if other variables are desired |
burnin |
Half of the converged sequence is thrown out as a burnin |
n.thin |
If the number of iterations user wants (n.run) is less than the number of converged sequence after burnin, we thin the sequence and store the thinning interval |
samples |
MCMC samples stored using jags. The returned samples have the form of mcmc.list and can be directly applied to coda functions |
max.gelman |
Maximum Gelman and Rubin's convergence diagnostic calculated for the final sample |
###Thrombolytic data example network <- with(thrombolytic,{ nodesplit.network.data(Outcomes, Study, Treat, N, response = "binomial", pair = c(3,9)) }) result <- nodesplit.network.run(network)
###Thrombolytic data example network <- with(thrombolytic,{ nodesplit.network.data(Outcomes, Study, Treat, N, response = "binomial", pair = c(3,9)) }) result <- nodesplit.network.run(network)
A dataset of 7 studies investigating the mean lost work-time reduction in patients given 4 dopamine agonists and placebo as adjunct therapy for Parkinson's disease. There is placebo and four active drugs coded 2 to 5.
parkinsons
parkinsons
A list of Outcomes, Treat, Study, N, covariate, and Treat.order
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013a), A Generalized Linear Modeling Framework for Pairwise and Network Meta-analysis of Randomized Controlled Trials, Medical Decision Making 33(5):607-617. doi:10.1177/0272989X12458724
A contrast level (i.e. treatment difference) dataset of 7 studies investigating the mean lost work-time reduction in patients given 4 dopamine agonists and placebo as adjunct therapy for Parkinson's disease. Placebo is coded as 1, and four active drugs are coded 2 to 5. There is placebo, coded as 1, and four active drugs coded 2 to 5.
parkinsons_contrast
parkinsons_contrast
A list of Outcomes, Treat, SE, na, and V
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013a), A Generalized Linear Modeling Framework for Pairwise and Network Meta-analysis of Randomized Controlled Trials, Medical Decision Making 33(5):607-617. doi:10.1177/0272989X12458724
This function uses plotting function in coda package to plot mcmc.list object
## S3 method for class 'contrast.network.result' plot(x, ...)
## S3 method for class 'contrast.network.result' plot(x, ...)
x |
Result object created by |
... |
Additional arguments affecting the plot produced |
None
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) }) result <- contrast.network.run(network) plot(result)
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) }) result <- contrast.network.run(network) plot(result)
This function uses plotting function in coda package to plot mcmc.list object
## S3 method for class 'network.result' plot(x, ...)
## S3 method for class 'network.result' plot(x, ...)
x |
Result object created by |
... |
Additional arguments affecting the plot produced |
None
network <- with(statins, { network.data(Outcomes, Study, Treat, N = N, response = "binomial", Treat.order = c("Placebo", "Statin"), covariate = covariate, covariate.type = "discrete") }) result <- network.run(network) plot(result, only.pars = "sd")
network <- with(statins, { network.data(Outcomes, Study, Treat, N = N, response = "binomial", Treat.order = c("Placebo", "Statin"), covariate = covariate, covariate.type = "discrete") }) result <- network.run(network) plot(result, only.pars = "sd")
This function uses plotting function in coda package to plot mcmc.list object
## S3 method for class 'ume.network.result' plot(x, ...)
## S3 method for class 'ume.network.result' plot(x, ...)
x |
Result object created by |
... |
Additional arguments affecting the plot produced |
None
network <- with(smoking, { ume.network.data(Outcomes, Study, Treat, N = N, response = "binomial", type = "random") }) result <- ume.network.run(network) plot(result)
network <- with(smoking, { ume.network.data(Outcomes, Study, Treat, N = N, response = "binomial", type = "random") }) result <- ume.network.run(network) plot(result)
This function makes a table of ranking for each treament. Each number in the cell represents a probability certain treatment was in such rank.
This table is also stored as an output from network.run
.
rank.tx(result)
rank.tx(result)
result |
Object created by |
Returns a table of ranking
network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) rank.tx(result)
network <- with(blocker, { network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- network.run(network) rank.tx(result)
This function calculates relative effects for base treatment and comparison treatments.
relative.effects( result, base.treatment = NULL, comparison.treatments = NULL, base.category = NULL, comparison.categories = NULL, covariate = NULL )
relative.effects( result, base.treatment = NULL, comparison.treatments = NULL, base.category = NULL, comparison.categories = NULL, covariate = NULL )
result |
Object created by |
base.treatment |
Base treatment user wants for the relative effects. Base treatment is initially set by |
comparison.treatments |
Treatments that user wants to compare against base treatment. If set to null, all the treatments besides base treatment is considered as comparison treatments. |
base.category |
Base category user wants for the relative effects. Only used for multinomial data. |
comparison.categories |
Category that user wants to compare against base.category. Only used for multinomial data. |
covariate |
Covariate value at which to compute relative effects. Only used if covariate value is specified in the model. |
This returns a mcmc.list sample of relative effects for the base treatment specified. This allows user to obtain relative effects of different base.treatment after the sampling has been done.
For a simple summary, use relative.effects.table
.
network <- with(parkinsons, { network.data(Outcomes, Study, Treat, SE = SE, response = "normal") }) result <- network.run(network) summary(relative.effects(result, base.treatment = "Placebo"))
network <- with(parkinsons, { network.data(Outcomes, Study, Treat, SE = SE, response = "normal") }) result <- network.run(network) summary(relative.effects(result, base.treatment = "Placebo"))
This function creates a summary table of relative effects. Relative effects are in units of log odds ratio for binomial and multinomial data and real number scale for normal data.
relative.effects.table( result, summary_stat = "mean", probs = NULL, base.category = NULL )
relative.effects.table( result, summary_stat = "mean", probs = NULL, base.category = NULL )
result |
Object created by |
summary_stat |
Specifies what type of statistics user wants. Options are: "mean", "ci", "quantile", "sd", "p-value". "ci" gives 95 "p-value" is the probability relative effect (in binomial, log odds ratio) is less than 0. |
probs |
Used only for the quantile summary. Specifies which quantile user wants the summary of (should be one numeric value between 0 to 1) |
base.category |
Specifies for which base category user wants for the summary. Used only for multinoimal. |
Returns relative effects table
#cardiovascular network <- with(cardiovascular,{ network.data(Outcomes, Study, Treat, N, response = "multinomial") }) result <- network.run(network) exp(relative.effects.table(result)) #look at odds ratio instead of log odds ratio
#cardiovascular network <- with(cardiovascular,{ network.data(Outcomes, Study, Treat, N, response = "multinomial") }) result <- network.run(network) exp(relative.effects.table(result)) #look at odds ratio instead of log odds ratio
Twenty-four studies, including 2 three-arm trials, compared 4 smoking cessation counseling programs and recorded the number of individuals with successful smoking cessation at 6 to 12 month. Counseling programs include 1 = no intervention, 2 = self-help, 3 = individual counseling, and 4 = group counseling.
smoking
smoking
A list of Outcomes, Treat, Study, and N
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013a), A Generalized Linear Modeling Framework for Pairwise and Network Meta-analysis of Randomized Controlled Trials, Medical Decision Making 33(5):607-617. doi:10.1177/0272989X12458724
A dataset of 19 trials of statins for cholesterol lowering vs. placebo. Each trial has a subgroup indicator for primary prevention (patients included had no previous heart disease) or secondary prevention (patients had previous heart disease). Dummy variable is coded such that covariate is equal to 1 if a study is a secondary prevention study and 0 if a study is a primary prevention study.
statins
statins
A list of Outcomes, Treat, Study, N, covariate, and Treat.order
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013b), Heterogeneity-Subgroups, Meta-Regression, Bias, and Bias-Adjustment, Medical Decision Making 33(5):618-640. doi:10.1177/0272989X13485157
SUCRA is the surface under the cumulative ranking distribution defined in Salanti et al. (2011)
sucra(result, txnames = NULL, catnames = NULL)
sucra(result, txnames = NULL, catnames = NULL)
result |
Object created by |
txnames |
Treatment names used in creating legend |
catnames |
Category names. Only used in multinomial. |
Returns SUCRA for each treatment
G. Salanti, A.E. Ades, J.P.A. Ioannidisa (2011), Graphical methods and numerical summaries for presenting results from multiple-treatment meta-analysis: an overview and tutorial, Journal of Clinical Epidemiology 64(2):163-71. doi:10.1016/j.jclinepi.2010.03.016
########### certolizumab (with baseline risk) network <- with(certolizumab, { network.data(Outcomes, Study, Treat, N=N, response = "binomial", Treat.order, baseline = "common", hy.prior = list("dhnorm", 0, 9.77)) }) result <- network.run(network) sucra(result)
########### certolizumab (with baseline risk) network <- with(certolizumab, { network.data(Outcomes, Study, Treat, N=N, response = "binomial", Treat.order, baseline = "common", hy.prior = list("dhnorm", 0, 9.77)) }) result <- network.run(network) sucra(result)
contrast.network.run
This function uses summary function in coda package to summarize mcmc.list object. Monte carlo error (Time-series SE) is also obtained using the coda package and is printed in the summary as a default.
## S3 method for class 'contrast.network.result' summary(object, ...)
## S3 method for class 'contrast.network.result' summary(object, ...)
object |
Result object created by |
... |
Additional arguments affecting the summary produced |
Returns summary of the contrast network model result
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) }) result <- contrast.network.run(network) summary(result)
network <- with(parkinsons_contrast, { contrast.network.data(Outcomes, Treat, SE, na, V) }) result <- contrast.network.run(network) summary(result)
network.run
This function uses summary function in coda package to summarize mcmc.list object. Monte carlo error (Time-series SE) is also obtained using the coda package and is printed in the summary as a default.
## S3 method for class 'network.result' summary(object, ...)
## S3 method for class 'network.result' summary(object, ...)
object |
Result object created by |
... |
Additional arguments affecting the summary produced |
Returns summary of the network model result
network <- with(statins, { network.data(Outcomes, Study, Treat, N = N, response = "binomial", Treat.order = c("Placebo", "Statin"), covariate = covariate, covariate.type = "discrete") }) result <- network.run(network) summary(result)
network <- with(statins, { network.data(Outcomes, Study, Treat, N = N, response = "binomial", Treat.order = c("Placebo", "Statin"), covariate = covariate, covariate.type = "discrete") }) result <- network.run(network) summary(result)
nodesplit.network.run
This function uses summary function in coda package to summarize mcmc.list object. Monte carlo error (Time-series SE) is also obtained using the coda package and is printed in the summary as a default.
## S3 method for class 'nodesplit.network.result' summary(object, ...)
## S3 method for class 'nodesplit.network.result' summary(object, ...)
object |
Result object created by |
... |
Additional arguments affecting the summary produced |
Returns summary of the nodesplit network model result
###Parkinsons data example network <- with(parkinsons, { nodesplit.network.data(Outcomes, Study, Treat, SE = SE, response = "normal", Treat.order = Treat.order, pair = c("Placebo", "Ropinirole")) }) result <- nodesplit.network.run(network) summary(result)
###Parkinsons data example network <- with(parkinsons, { nodesplit.network.data(Outcomes, Study, Treat, SE = SE, response = "normal", Treat.order = Treat.order, pair = c("Placebo", "Ropinirole")) }) result <- nodesplit.network.run(network) summary(result)
ume.network.run
This function uses summary function in coda package to summarize mcmc.list object. Monte carlo error (Time-series SE) is also obtained using the coda package and is printed in the summary as a default.
## S3 method for class 'ume.network.result' summary(object, ...)
## S3 method for class 'ume.network.result' summary(object, ...)
object |
Result object created by |
... |
Additional arguments affecting the summary produced |
Returns summary of the ume network model result
network <- with(smoking, { ume.network.data(Outcomes, Study, Treat, N = N, response = "binomial", type = "random") }) result <- ume.network.run(network) summary(result)
network <- with(smoking, { ume.network.data(Outcomes, Study, Treat, N = N, response = "binomial", type = "random") }) result <- ume.network.run(network) summary(result)
A dataset consisting of 50 trials comparing 8 thrombolytic drugs and percutaneous transluminal coronary angioplasty, following acute myocardial infarction. Data consist of the number of deaths in 30 or 35 days and the number of patients in each treatment arm. There are 9 treatments in total: streptokinase (1), alteplase (2), accelerated alteplase (3), streptokinase + alteplase (4), reteplase (5), tenecteplase (6), percutaneous transluminal coronary angioplasty (7), urokinase (8), anistreptilase (9)
thrombolytic
thrombolytic
A list of Outcomes, Treat, Study, and N
S. Dias, A.J. Sutton, A.E. Ades, and N.J. Welton (2013a), A Generalized Linear Modeling Framework for Pairwise and Network Meta-analysis of Randomized Controlled Trials, Medical Decision Making 33(5):607-617. doi:10.1177/0272989X12458724
This is similar to the function network.data
, except this is used for the unrelated mean effects model.
ume.network.data( Outcomes, Study, Treat, N = NULL, SE = NULL, response = NULL, Treat.order = NULL, type = "random", mean.mu = NULL, prec.mu = NULL, mean.d = NULL, prec.d = NULL, hy.prior = list("dunif", 0, 5), dic = TRUE )
ume.network.data( Outcomes, Study, Treat, N = NULL, SE = NULL, response = NULL, Treat.order = NULL, type = "random", mean.mu = NULL, prec.mu = NULL, mean.d = NULL, prec.d = NULL, hy.prior = list("dunif", 0, 5), dic = TRUE )
Outcomes |
Arm-level outcomes. If it is a multinomial response, the matrix would be arms (row) by multinomial categories (column). If it is binomial or normal, it would be a vector. |
Study |
A vector of study indicator for each arm |
Treat |
A vector of treatment indicator for each arm. Treatments should have positive integer values starting from 1 to total number of treatments. In a study, lowest number is taken as the baseline treatment. |
N |
A vector of total number of observations in each arm. Used for binomial and multinomial responses. |
SE |
A vector of standard error for each arm. Used only for normal response. |
response |
Specification of the outcomes type. Must specify one of the following: "normal", "binomial", or "multinomial". |
Treat.order |
Treatment order which determines how treatments are compared. The first treatment that is specified is considered to be the baseline treatment. Default order is alphabetical. If the treatments are coded 1, 2, etc, then the treatment with a value of 1 would be assigned as a baseline treatment. |
type |
Type of model fitted: either "random" for random effects model or "fixed" for fixed effects model. Default is "random". |
mean.mu |
Prior mean for the study effect (baseline risk) |
prec.mu |
Prior precision for the study effect (baseline risk) |
mean.d |
Prior mean for the relative effect |
prec.d |
Prior precision for the relative effect |
hy.prior |
Prior for the heterogeneity parameter. Supports uniform, gamma, and half normal for normal. It should be a list of length 3, where first element should be the distribution (one of dunif, dgamma, dhnorm, dwish) and the next two are the parameters associated with the distribution. For example, list("dunif", 0, 5) give uniform prior with lower bound 0 and upper bound 5 for the heterogeneity parameter. |
dic |
This is an indicator for whether user wants to calculate DIC. Model stores less information if you set it to FALSE. |
Creates list of variables that are used to run the model using ume.network.run
r |
|
t |
|
nstudy |
Number of study |
na |
Number of arms for each study |
ntreat |
Number of treatment |
b.id |
Indicator in sequence of all treatments for which treatment is base treatment in Study |
code |
Rjags model file code that is generated using information provided by the user. To view model file inside R in a nice format, use |
S. Dias, N.J. Welton, A.J. Sutton, D.M. Caldwell, G. Lu, and A.E. Ades (2013), Evidence synthesis for decision making 4: inconsistency in networks of evidence based on randomized controlled trials, Medical Decision Making 33(5):641-656. doi:10.1177/0272989X12455847
network <- with(thrombolytic, { ume.network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) network
network <- with(thrombolytic, { ume.network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) network
This is similar to the function network.run
, except this is used for the unrelated mean effects model.
ume.network.run( network, inits = NULL, n.chains = 3, max.run = 1e+05, setsize = 10000, n.run = 50000, conv.limit = 1.05, extra.pars.save = NULL )
ume.network.run( network, inits = NULL, n.chains = 3, max.run = 1e+05, setsize = 10000, n.run = 50000, conv.limit = 1.05, extra.pars.save = NULL )
network |
network object created from |
inits |
Initial values for the parameters being sampled. If left unspecified, program will generate reasonable initial values. |
n.chains |
Number of chains to run |
max.run |
Maximum number of iterations that user is willing to run. If the algorithm is not converging, it will run up to |
setsize |
Number of iterations that are run between convergence checks. If the algorithm converges fast, user wouldn't need a big setsize. The number that is printed between each convergence checks is the gelman-rubin diagnostics and we would want that to be below the conv.limit the user specifies. |
n.run |
Final number of iterations that the user wants to store. If after the algorithm converges, user wants less number of iterations, we thin the sequence. If the user wants more iterations, we run extra iterations to reach the specified number of runs |
conv.limit |
Convergence limit for Gelman and Rubin's convergence diagnostic. Point estimate is used to test convergence of parameters for study effect (eta), relative effect (d), and heterogeneity (log variance (logvar)). |
extra.pars.save |
Parameters that user wants to save besides the default parameters saved. See code using |
data_rjags |
Data that is put into rjags function jags.model |
inits |
Initial values that are either specified by the user or generated as a default |
pars.save |
Parameters that are saved. Add more parameters in extra.pars.save if other variables are desired |
burnin |
Half of the converged sequence is thrown out as a burnin |
n.thin |
If the number of iterations user wants (n.run) is less than the number of converged sequence after burnin, we thin the sequence and store the thinning interval |
samples |
MCMC samples stored using jags. The returned samples have the form of mcmc.list and can be directly applied to coda functions |
max.gelman |
Maximum Gelman and Rubin's convergence diagnostic calculated for the final sample |
deviance |
Contains deviance statistics such as pD (effective number of parameters) and DIC (Deviance Information Criterion) |
network <- with(thrombolytic, { ume.network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- ume.network.run(network, n.run = 10000)
network <- with(thrombolytic, { ume.network.data(Outcomes, Study, Treat, N = N, response = "binomial") }) result <- ume.network.run(network, n.run = 10000)
This function calculates correlation matrix from the variance matrix for heterogeneity parameter. Only used for multinomial.
variance.tx.effects(result)
variance.tx.effects(result)
result |
Object created by |
Returns correlation matrix
#cardiovascular network <- with(cardiovascular, { network.data(Outcomes, Study, Treat, N, response = "multinomial") }) result <- network.run(network) variance.tx.effects(result)
#cardiovascular network <- with(cardiovascular, { network.data(Outcomes, Study, Treat, N, response = "multinomial") }) result <- network.run(network) variance.tx.effects(result)