This expands on Section 4.4.3 of our book. The basic random effects meta-analysis extends the common effect model by allowing studies to sample from their own populations, so that the true contrasts or intervention effects in the study populations differ. It seems reasonable to represent this between-study variation or heterogeneity with a normal distribution because of the Central Limit Theorem (discussed in Chapter 4 of our book). This produces a multilevel model:

gen se2 = se_logor^2

bayesmh md U[id], likelihood(normal(se2)) ///
                  prior({md:_cons}, ADD_YOUR_PRIOR) ///
                  prior({U}, normal(0,{tau2})) ///
                  prior({tau2}, ADD_YOUR_PRIOR) ///
                  nchains(2) ///
                  burnin(10000) ///
                  mcmcsize(10000) ///
                  showreffects ///
                  saving("stata_chains.dta", ///
                         replace) ///
                  init1({md:_cons} -0.2 ///
                        {tau2}  0.5) ///
                  init2({md:_cons} 0.2 ///
                        {tau2} 0.3)

bayesstats grubin
bayesgraph diagnostics {_cons}, ///
   title("Mean difference")
bayesgraph diagnostics {tau2}, ///
   title("Het. variance")

Here, we again start with a contrast-based model and use the log odds ratio as an example of a study statistic with an asymptotically normal sampling distribution. We are also taking the study estimates of the standard errors as totally correct and certain. That makes the model a Bayesian match for the frequentist DerSimonian-Laird estimator.

The code is explained in Section 4.4.3 of our book. The syntax is detailed in the Stata bayesmh manual entry. As previously for the common effect meta-analysis, we are treating it as a regression with no covariate which seeks to predict md, and fixing the standard error of md.

We illustrate methods for prior and posterior predictive checking in another post.

Funnel behaviour

There is a challenge to MCMC algorithms that is common in multilevel models when the heterogeneity standard deviation approaches zero, and this is referred to as a funnel (sometimes Neal’s funnel) problem.

Although Stan’s algorithm identifies problematic iterations of its algorithm as “divergent transitions”, Stata does not. One way to avoid it is to use a prior on tau that gives low prior density to values close to zero. Half-normal, half-t, or half-Cauchy will be prone to this, because they give the highest prior density to values close to zero, while gamma, lognormal, chi-squared, or bespoke elicited priors can avoid the problem, but only if you are willing to be more informative about tau. The slow mixing traceplots in Figure 2.12 of the book are in fact caused by funnel behaviour.

Including uncertainty in the standard errors

When the sampling distribution is asymptotically normal, the natural way to acknowledge uncertainty in the standard error is to swap the normal likelihood for the t-distribution with n[j]-2 degrees of freedom. This model is analogous to the Sidik-Jonkman estimator with the Hartung-Knapp adjustment, and we address this in Section 4.6 of the book. This also has the effect of making the meta-analysis a little more robust to outlier studies.

gen df = n-2

bayesmh md U[id], likelihood(t(se2, df)) ///
                  prior({md:_cons}, ADD_YOUR_PRIOR) ///
                  prior({U}, normal(0,{tau2})) ///
                  prior({tau2}, ADD_YOUR_PRIOR) ///
                  nchains(2) ///
                  burnin(10000) ///
                  mcmcsize(10000) ///
                  showreffects ///
                  saving("stata_chains.dta", ///
                         replace) ///
                  init1({md:_cons} -0.2 ///
                        {tau2}  0.5) ///
                  init2({md:_cons} 0.2 ///
                        {tau2} 0.3)

This student’s t distribution is the exact likelihood for means, but is heuristic for log odds ratios, simply chosen for its higher probability in the tails, and other options could be tried, including changing the degrees of freedom for the t.

tags: #stata, #stata-repo, #repo


Discover more from The Bayesian Meta-Analysis Network

Subscribe to get the latest posts sent to your email.

Leave a Reply

Discover more from The Bayesian Meta-Analysis Network

Subscribe now to keep reading and get access to the full archive.

Continue reading