Skip to contents

Performs a Bayesian pairwise meta-analysis for each pairwise comparison with at least two trials in the network.

Usage

run_series_meta(full, n_chains, n_iter, n_burnin, n_thin, inits = NULL)

Arguments

full

An object of S3 class run_model. See 'Value' in run_model.

n_chains

Integer specifying the number of chains for the MCMC sampling; an argument of the jags function of the R-package R2jags. The default argument is 2.

n_iter

Positive integer specifying the number of Markov chains for the MCMC sampling; an argument of the jags function of the R-package R2jags. The default argument is 10000.

n_burnin

Positive integer specifying the number of iterations to discard at the beginning of the MCMC sampling; an argument of the jags function of the R-package R2jags. The default argument is 1000.

n_thin

Positive integer specifying the thinning rate for the MCMC sampling; an argument of the jags function of the R-package R2jags. The default argument is 1.

inits

A list with the initial values for the parameters; an argument of the jags function of the R-package R2jags. The default argument is NULL, and JAGS generates the initial values.

Value

An R2jags output on the summaries of the posterior distribution, and the Gelman-Rubin convergence diagnostic (Gelman et al., 1992) of the following monitored parameters:

EM

The summary effect estimate (according to the argument measure defined in run_model) of each observed pairwise comparison with at least two trials in the network.

tau

The between-trial standard deviation for pairwise comparisons with at least two trials, when the random-effects model has been specified.

single

A binary vector that indicates the comparisons in EM with one trial.

Details

run_series_meta inherits the arguments data, measure, model, assumption, heter_prior, mean_misspar, and var_misspar from run_model (now contained in the argument full). This prevents specifying a different Bayesian model from that considered in run_model. Therefore, the user needs first to apply run_model, and then use run_series_meta (see 'Examples').

For a binary outcome, when measure is "RR" (relative risk) or "RD" (risk difference) in run_model, run_series_meta currently performs a series of pairwise meta-analysis using the odds ratio as effect measure for being the base-case effect measure in run_model for a binary outcome (see also 'Details' in run_model).

run_series_meta runs a series of Bayesian pairwise meta-analyses in JAGS. The progress of the simulation appears on the R console. The number of times the function is used is also printed on the console (in red) and is equal to the number of observed pairwise comparisons in the network (see 'Examples'). The model is updated until convergence using the autojags function of the R-package R2jags with 2 updates and number of iterations and thinning equal to n_iter and n_thin, respectively.

The output of run_series_meta is not end-user-ready. The series_meta_plot function inherits the output of run_series_meta as an S3 object and processes it further to provide an end-user-ready output.

run_series_meta can be used only for a network of interventions. In the case of two interventions, the execution of the function will be stopped and an error message will be printed on the R console.

References

Gelman A, Rubin DB. Inference from iterative simulation using multiple sequences. Stat Sci 1992;7(4):457–72. doi: 10.1214/ss/1177011136

Author

Loukia M. Spineli

Examples

data("nma.dogliotti2014")

# Show the first six trials of the dataset (one-trial-per-row format)
head(nma.dogliotti2014)
#>              study t1 t2 t3   r1   r2 r3  m1  m2 m3   n1   n2 n3
#> 1     BAATAF, 1990  1  7 NA  195  188 NA   0  21 NA  208  212 NA
#> 2     SPINAF, 1992  1  7 NA  186  172 NA  56  81 NA  265  260 NA
#> 3    SPAF-II, 1994  2  7 NA  480  478 NA  23  38 NA  545  555 NA
#> 4      PATAF, 1999  2  7 NA  243   86 NA  54  42 NA  319  131 NA
#> 5 ACTIVE (W), 2006  3  7 NA 2825 3089 NA 410 223 NA 3335 3371 NA
#> 6       JAST, 2006  1  2 NA  338  313 NA  89  96 NA  445  426 NA

# Read results from 'run_model' (using the default arguments)
res <- readRDS(system.file('extdata/res_dogliotti.rds', package = 'rnmamod'))

# \donttest{
# Run separate random-effects pairwise meta-analyses
# Note: Ideally, set 'n_iter' to 10000 and 'n_burnin' to 1000
run_series_meta(full = res,
                n_chains = 3,
                n_iter = 1000,
                n_burnin = 100,
                n_thin = 1)
#> JAGS generates initial values for the parameters.
#> 1 out of 11 observed comparisons (and model updating until convergence)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 20
#>    Unobserved stochastic nodes: 29
#>    Total graph size: 535
#> 
#> Initializing model
#> 
#> 2 out of 11 observed comparisons (and model updating until convergence)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 28
#>    Unobserved stochastic nodes: 37
#>    Total graph size: 704
#> 
#> Initializing model
#> 
#> 3 out of 11 observed comparisons (and model updating until convergence)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 4
#>    Unobserved stochastic nodes: 13
#>    Total graph size: 194
#> 
#> Initializing model
#> 
#> 4 out of 11 observed comparisons (and model updating until convergence)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 16
#>    Unobserved stochastic nodes: 25
#>    Total graph size: 449
#> 
#> Initializing model
#> 
#> 5 out of 11 observed comparisons (and model updating until convergence)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 4
#>    Unobserved stochastic nodes: 13
#>    Total graph size: 194
#> 
#> Initializing model
#> 
#> 6 out of 11 observed comparisons (and model updating until convergence)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 4
#>    Unobserved stochastic nodes: 13
#>    Total graph size: 194
#> 
#> Initializing model
#> 
#> 7 out of 11 observed comparisons (and model updating until convergence)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 4
#>    Unobserved stochastic nodes: 13
#>    Total graph size: 194
#> 
#> Initializing model
#> 
#> 8 out of 11 observed comparisons (and model updating until convergence)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 4
#>    Unobserved stochastic nodes: 13
#>    Total graph size: 194
#> 
#> Initializing model
#> 
#> 9 out of 11 observed comparisons (and model updating until convergence)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 4
#>    Unobserved stochastic nodes: 13
#>    Total graph size: 194
#> 
#> Initializing model
#> 
#> 10 out of 11 observed comparisons (and model updating until convergence)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 4
#>    Unobserved stochastic nodes: 13
#>    Total graph size: 194
#> 
#> Initializing model
#> 
#> 11 out of 11 observed comparisons (and model updating until convergence)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 4
#>    Unobserved stochastic nodes: 13
#>    Total graph size: 194
#> 
#> Initializing model
#> 
#> $EM
#>    t1 t2        mean        sd       2.5%        25%         50%        75%
#> 1   1  7  1.14242275 0.4363724  0.2210797  0.8917784  1.15181711 1.39770866
#> 2   2  7  0.52649309 0.4017737 -0.2309621  0.2763153  0.51244548 0.76296008
#> 3   3  7  0.64542855 1.0975540 -1.8669300  0.1767836  0.66442360 1.12633931
#> 4   1  2  0.47130613 0.3857150 -0.2993994  0.2096514  0.49999049 0.73249926
#> 5   2  3  0.30677251 1.0184644 -1.8287333 -0.1263196  0.28633858 0.66825197
#> 6   6  7 -0.25041702 1.0646452 -2.5978521 -0.6799092 -0.24218987 0.19189678
#> 7   7  8  0.21077796 1.0132447 -2.0449207 -0.1831483  0.24382486 0.62767073
#> 8   2  8  0.80437524 1.1121196 -1.6032205  0.2870206  0.81950694 1.36302388
#> 9   4  5  0.28985696 1.0303283 -1.8417810 -0.2012181  0.28523981 0.77651019
#> 10  4  7 -0.07585558 1.1060120 -2.4613486 -0.5067290 -0.09788813 0.38238133
#> 11  5  7 -0.37376412 1.0093780 -2.6295197 -0.8020869 -0.38593653 0.04305274
#>       97.5%     Rhat n.eff
#> 1  1.993313 1.019894   130
#> 2  1.410124 1.021437   150
#> 3  2.985125 1.003451  1300
#> 4  1.207935 1.040647    55
#> 5  2.538776 1.005635  1000
#> 6  2.067315 1.003719   800
#> 7  2.227389 1.002998  3000
#> 8  2.936793 1.009485   630
#> 9  2.452058 1.003500  1700
#> 10 2.324239 1.000962  3000
#> 11 1.924089 1.002670   940
#> 
#> $tau
#>   t1 t2      mean        sd        2.5%       25%       50%       75%    97.5%
#> 1  1  7 0.5218998 0.3205085 0.064555407 0.2853136 0.4670844 0.7007587 1.280303
#> 2  2  7 0.5720488 0.2869939 0.179296984 0.3709255 0.5149431 0.7099747 1.275999
#> 4  1  2 0.3207736 0.2698288 0.006475208 0.1249360 0.2538136 0.4386692 1.057509
#>       Rhat n.eff
#> 1 1.016908   270
#> 2 1.027042   100
#> 4 1.057987   170
#> 
#> $measure
#> [1] "OR"
#> 
#> $model
#> [1] "RE"
#> 
#> $single
#>  [1] 0 0 1 0 1 1 1 1 1 1 1
#> 
#> $n_chains
#> [1] 3
#> 
#> $n_iter
#> [1] 1000
#> 
#> $n_burnin
#> [1] 100
#> 
#> $n_thin
#> [1] 1
#> 
#> attr(,"class")
#> [1] "run_series_meta"
# }