### load data
data(dat.hart1999)
### calculate log incidence rate ratios and corresponding sampling variances
dat <- escalc(measure="IRR", x1i=x1i, x2i=x2i, t1i=t1i, t2i=t2i, data=dat.hart1999)
dat
### meta-analysis of log incidence rate ratios using a random-effects model
res <- rma(yi, vi, data=dat)
res
### average incidence rate ratio with 95\% CI
predict(res, transf=exp)
### forest plot with extra annotations
forest(res, xlim=c(-14, 6), at=log(c(.05, .25, 1, 4)), atransf=exp,
slab=paste(dat$study, "(", dat$year, ")", sep=""),
ilab=cbind(paste(dat$x1i, "/", dat$t1i, sep=""),
paste(dat$x2i, "/", dat$t2i, sep="")),
ilab.xpos=c(-8,-5), cex=.85)
op <- par(cex=.85, font=2)
text(-14, 7.5, "Study (Year)", pos=4)
text(6, 7.5, "IRR [95% CI]", pos=2)
text(c(-8,-5), 8.0, c("Strokes /", "Strokes /"))
text(c(-8,-5), 7.5, c("Person-Time", "Person-Time"))
text(c(-8,-5), 8.5, c("Warfarin", "Control"))
segments(x0=-9, y0=8.25, x1=-4, y1=8.25)
par(op)
### meta-analysis of incidence rate differences using a random-effects model
res <- rma(measure="IRD", x1i=x1i, x2i=x2i, t1i=t1i, t2i=t2i, data=dat.hart1999)
res
Run the code above in your browser using DataLab