### load BCG vaccine data
data(dat.bcg)
### meta-analysis of the log risk rates using a random-effects model
res <- rma(ai=tpos, bi=tneg, ci=cpos, di=cneg,
data=dat.bcg, measure="RR", method="REML")
blup(res, transf=exp)
### illustrate shrinkage of BLUPs towards the (estimated) population average
rri <- exp(escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)$yi)
blupi <- blup(res, transf=exp)$pred
plot(NA, NA, xlim=c(.8,2.2), ylim=c(0,2), pch=19,
xaxt="n", bty="n", xlab="", ylab="Relative Risk")
segments(rep(1,13), rri, rep(2,13), blupi, col="gray")
points(rep(1,13), rri, pch=19)
points(rep(2,13), blupi, pch=19)
axis(side=1, at=c(1,2), labels=c("Observed Values", "BLUPs"), lwd=0)
abline(h=predict(res, transf=exp)$pred, lwd=2)
Run the code above in your browser using DataLab