Hi,
As a beginner, I am trying to do a Bayesian three-level meta-analysis with brms. Following the https://doing-meta.guide/bayesian-ma , here is the code for my main model.
#Main model
main.model <- brm(yi|se(seTE)~ 0 + Intercept + (1|es_id) + (1|study),
data = dat,
save_pars = save_pars(all = TRUE),
prior = c(prior(normal(0, 1), class = b),
prior(cauchy(0, 0.5), class = sd)),
iter = 5000, control = list(adapt_delta = .999, max_treedepth = 15))
summary(main.model)
Family: gaussian
Links: mu = identity
Formula: yi | se(seTE) ~ 0 + Intercept + (1 | es_id) + (1 | study)
Data: dat (Number of observations: 40)
Draws: 4 chains, each with iter = 5000; warmup = 2500; thin = 1;
total post-warmup draws = 10000
Multilevel Hyperparameters:
~es_id (Number of levels: 40)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.24 0.07 0.11 0.37 1.00 2875 3366
~study (Number of levels: 17)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.11 0.08 0.00 0.30 1.00 2052 3909
Regression Coefficients:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 0.17 0.07 0.04 0.31 1.00 6212 6615
Further Distributional Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 0.00 0.00 0.00 0.00 NA NA NA
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
My questions are: What are the code for
- within-study variance and between-study variance and their CrI.
- plots of posterior distribution of g, τ(2) and τ(3) in the main model.
- Heterogeneity I2 statistics for different levels (Cheung, 2014).
Best,
data_YYH.csv (1.1 KB)
Yuan