### copy data into 'dat' and examine data
dat <- dat.bornmann2007
head(dat, 16)
if (FALSE) {
### load metafor package
library(metafor)
### calculate log odds ratios and corresponding sampling variances
dat <- escalc(measure="OR", ai=waward, n1i=wtotal, ci=maward, n2i=mtotal, data=dat)
### fit multilevel meta-analysis model
res <- rma.mv(yi, vi, random = ~ 1 | study/obs, data=dat)
res
### estimated average odds ratio (with 95% CI/PI)
predict(res, transf=exp, digits=2)
### test for a difference between fellowship and grant applications
res <- rma.mv(yi, vi, mods = ~ type, random = ~ 1 | study/obs, data=dat)
res
predict(res, newmods=0:1, transf=exp, digits=2)
}
Run the code above in your browser using DataLab