data("Peto1980")
if (FALSE) {
# compute effect sizes (log odds ratios) from count data
# (using "metafor" package's "escalc()" function):
require("metafor")
peto.es <- escalc(measure="OR",
ai=treat.events, n1i=treat.cases,
ci=control.events, n2i=control.cases,
slab=publication, data=Peto1980)
print(peto.es)
# check sensitivity to different prior choices:
peto.ma01 <- bayesmeta(peto.es)
peto.ma02 <- bayesmeta(peto.es, tau.prior=function(t){dhalfnormal(t, scale=1)})
par(mfrow=c(2,1))
plot(peto.ma01, which=4, prior=TRUE, taulim=c(0,1), main="uniform prior")
plot(peto.ma02, which=4, prior=TRUE, taulim=c(0,1), main="half-normal prior")
par(mfrow=c(1,1))
# compare heterogeneity (tau) estimates:
print(rbind("uniform" =peto.ma01$summary[,"tau"],
"half-normal"=peto.ma02$summary[,"tau"]))
# compare effect (mu) estimates:
print(rbind("uniform" =peto.ma01$summary[,"mu"],
"half-normal"=peto.ma02$summary[,"mu"]))
summary(peto.ma02)
forestplot(peto.ma02)
plot(peto.ma02)
}
Run the code above in your browser using DataLab