# show data:
dat.dumouchel1994
if (FALSE) {
# derive effect sizes (log-ORs):
library(metafor)
no2 <- escalc(measure="OR", yi=log(or),
sei=(log(upper)-log(lower))/(2*qnorm(0.975)),
slab=study, data=dat.dumouchel1994)
summary(no2)
# compute overall meta-analysis:
library(bayesmeta)
bm01 <- bayesmeta(no2, tau.prior="DuMouchel")
# show results:
bm01
forestplot(bm01)
traceplot(bm01)
# perform meta-regression;
# specify regressor matrix:
X <- model.matrix( ~ smoke + no2 + gender, data=no2)
colnames(X) <- c("intercept", "smoke", "no2", "gender")
# perform regression:
bm02 <- bmr(no2, X=X, tau.prior="DuMouchel")
# show results:
bm02
forestplot(bm02)
#forestplot(bm02, xlab="log-OR",
# X.mean=rbind("none" = c(1,0,0,0),
# "smoke" = c(1,1,0,0),
# "no2" = c(1,0,1,0),
# "gender" = c(1,0,0,1),
# "all three" = c(1,1,1,1)))
traceplot(bm02)
}
Run the code above in your browser using DataLab