Exercise 7: Bayesian meta-analysis

In 2014, Crins et al. 1 published a meta-analysis assessing the incidence of acute rejection (AR) with or without Interleukin-2 receptor antagonists. In this exercise we will recreate this analysis.

  1. Load the package bayesmeta 2 and the data from Crins et al. (2014) with the R command data("CrinsEtAl2014").

    library(bayesmeta)
    data(CrinsEtAl2014)
  2. Play around with the companion shiny app at: https://rshiny.gwdg.de/apps/bayesmeta/.
    If the website is unavailable, you can launch the app locally by running the 2 following commands from :

    library("shiny")
    install.packages("rhandsontable")
    runUrl("http://www.gwdg.de/~croever/bayesmeta/bayesmeta-app.zip")
  3. Directly in the console now, using the escalc() function from the package metafor, compute the estimated log odds ratios from the 6 considered studies alongside their sampling variances (ProTip: read the Measures for Dichotomous Variables section from the help of the escalc() function). Check that those are the same as the one on the online shiny app (ProTip: ‘sigma’ is the standard error, i.e. the square root of the sampling variance vi)

    library("metafor")
    crins.es <- escalc(measure = "OR", ai = exp.AR.events, n1i = exp.total, ci = cont.AR.events,
        n2i = cont.total, slab = publication, data = CrinsEtAl2014)
    crins.es[, c("publication", "yi", "vi")]
    publication yi vi
    Heffron (2003) -2.3097026 0.3593718
    Gibelli (2004) -0.4595323 0.3095760
    Schuller (2005) -2.3025851 0.7750000
    Ganschow (2005) -1.7578579 0.2078161
    Spada (2006) -1.2584610 0.4121591
    Gras (2008) -2.4178959 2.3372623

    NB: Log-odds ratios are symmetric around zero and have a sampling distribution closer to the normal distibution than the natural OR scale. For this reason, they are usually prefered for meta-analyses. Their sample variance is then computed as the sum of the inverse of all the counts in the \(2 \times 2\) associated contingency table3.

  4. Perform a random-effect meta-analysis of those data using the bayesmeta() function from the package bayesmeta, within . Use a uniform prior on \([0,4]\) for \(\tau\) and a Gaussian prior for \(\mu\) centered around \(0\) and with a standard deviation of \(4\).

  5. Write the corresponding random-effects Bayesian meta-analysis model (using math, not – yet).

  6. Use rjags to estimate the same model, saving the BUGS model in a .txt file (called crinsBUGSmodel.txt for instance).