### copy data into 'dat' and examine data
dat <- dat.frank2008
dat
if (FALSE) {
### load metafor package
library(metafor)
### calculate log odds ratios comparing ins/del versus ins/ins
dat <- escalc(measure="OR", ai=bc.ins.del, bi=bc.ins.ins,
ci=ct.ins.del, di=ct.ins.ins, data=dat)
### fit random-effects model and get the pooled odds ratio (with 95% CI)
res <- rma(yi, vi, data=dat)
res
predict(res, transf=exp, digits=2)
### calculate log odds ratios comparing del/del versus ins/ins
dat <- escalc(measure="OR", ai=bc.del.del, bi=bc.ins.ins,
ci=ct.del.del, di=ct.ins.ins, data=dat)
### fit random-effects model and get the pooled odds ratio (with 95% CI)
res <- rma(yi, vi, data=dat)
res
predict(res, transf=exp, digits=2)
### calculate log odds ratios comparing ins/del+del/del versus ins/ins
dat <- escalc(measure="OR", ai=bc.ins.del+bc.del.del, bi=bc.ins.ins,
ci=ct.ins.del+ct.del.del, di=ct.ins.ins, data=dat)
### fit random-effects model and get the pooled odds ratio (with 95% CI)
res <- rma(yi, vi, data=dat)
res
predict(res, transf=exp, digits=2)
############################################################################
### compute the relative excess heterozygosity in the controls
dat <- escalc(measure="REH", ai=ct.ins.ins, bi=ct.ins.del, ci=ct.del.del,
slab=study, data=dat)
### fit random-effects model and get the pooled REH value (with 90% CI)
res <- rma(yi, vi, data=dat, level=90)
res
predict(res, transf=exp, digits=2)
### draw forest plot
forest(res, atransf=exp, xlim=c(-1.4,1.4), at=log(c(0.5,5/7,1,7/5,2)))
segments(log(5/7), -2, log(5/7), res$k+1, lty="dotted")
segments(log(7/5), -2, log(7/5), res$k+1, lty="dotted")
}
Run the code above in your browser using DataLab