# load data:
data("BaetenEtAl2013")
# show data:
BaetenEtAl2013
if (FALSE) {
# compute effect sizes (logarithmic odds) from the count data:
as <- escalc(xi=events, ni=total, slab=study,
measure="PLO", data=BaetenEtAl2013)
# compute the unit information standard deviation (UISD):
uisd(as)
# perform meta-analysis
# (using uniform priors for effect and heterogeneity):
bm <- bayesmeta(as)
# show results (log-odds):
forestplot(bm, xlab="log-odds", zero=NA)
# show results (odds):
forestplot(bm, exponentiate=TRUE, xlab="odds", zero=NA)
# show posterior predictive distribution --
# in terms of log-odds:
bm$summary[,"theta"]
logodds <- bm$summary[c(2,5,6), "theta"]
logodds
# in terms of odds:
exp(logodds)
# in terms of probabilities:
(exp(logodds) / (exp(logodds) + 1))
# illustrate MAP prior density:
x <- seq(-3, 1, by=0.01)
plot(x, bm$dposterior(theta=x, predict=TRUE), type="l",
xlab="log-odds (response)", ylab="posterior predictive density")
abline(h=0, v=0, col="grey")
}
Run the code above in your browser using DataLab