Simple Bayesian Meta-Analysis

Pablo Emilio Verde

Jun 07 2024

library(jarbes)

Introduction

In this vignette we describe the function bmeta for simple Bayesian meta-analysis.

Bayesian meta-analysis model

Example: ppvipd

## Not run: 
library(jarbes)

#Example: ppvipd
data("ppvipd")
bm1 = bmeta(ppvipd)
#> module glm loaded
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 11
#>    Unobserved stochastic nodes: 26
#>    Total graph size: 70
#> 
#> Initializing model
summary(bm1)
#> Model specifications:
#>   Link function: Normal approximation
#> 
#>   Hyper-priors parameters: 
#>   Prior for mu: Normal[0, 100]
#>   Prior for 1/tau^2: Scale.Gamma[0.5, 1]
#> Posterior distributions: 
#>                            mean    sd   2.5%    25%    50%    75%  97.5%  Rhat
#> Mean (Pooled mean)       -0.894 0.165 -1.240 -0.995 -0.886 -0.785 -0.590 1.001
#> Predictive effect        -0.892 0.343 -1.642 -1.068 -0.873 -0.707 -0.206 1.001
#> Tau (between studies sd)  0.258 0.158  0.018  0.145  0.239  0.347  0.618 1.033
#>                          n.eff
#> Mean (Pooled mean)       12000
#> Predictive effect         9000
#> Tau (between studies sd)   210
#> 
#> -------------------
#> MCMC setup (fit using jags):  2  chains, each with  10000  iterations
#> (first 1000 discarded )
#> DIC: 18.694
#> pD: 5.253
plot(bm1, x.lim = c(-3, 1), y.lim = c(0, 3))


diagnostic(bm1, study.names = ppvipd$name, 
           post.p.value.cut = 0.1,
           lwd.forest = 1, shape.forest = 4)

Example: stemcells

data("stemcells")
stemcells$TE = stemcells$effect.size
stemcells$seTE = stemcells$se.effect
bm2 = bmeta(stemcells)
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 31
#>    Unobserved stochastic nodes: 66
#>    Total graph size: 167
#> 
#> Initializing model
summary(bm2)
#> Model specifications:
#>   Link function: Normal approximation
#> 
#>   Hyper-priors parameters: 
#>   Prior for mu: Normal[0, 100]
#>   Prior for 1/tau^2: Scale.Gamma[0.5, 1]
#> Posterior distributions: 
#>                           mean    sd   2.5%   25%   50%   75% 97.5%  Rhat n.eff
#> Mean (Pooled mean)       2.904 0.728  1.454 2.430 2.914 3.381 4.326 1.002  1500
#> Predictive effect        2.924 3.556 -4.073 0.616 2.908 5.248 9.911 1.001 18000
#> Tau (between studies sd) 3.426 0.611  2.407 2.993 3.365 3.795 4.774 1.001 18000
#> 
#> -------------------
#> MCMC setup (fit using jags):  2  chains, each with  10000  iterations
#> (first 1000 discarded )
#> DIC: 161.087
#> pD: 30.26
plot(bm2, x.lim = c(-1, 7), y.lim = c(0, 1))

diagnostic(bm2, study.names = stemcells$trial,
           post.p.value.cut = 0.05,
           lwd.forest = 0.5, shape.forest = 4)