Last active
October 2, 2020 17:29
-
-
Save kylehamilton/09683d4b13b9c1db4d15b2b4b3ae5b51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# W. Kyle Hamilton | Universtiy of California, Merced | |
# kylehamilton.com | |
library(metafor) | |
author <- | |
c("Mitja et al 2020", | |
"Boulware et al 2020", | |
"Rajasingham et al 2020", | |
"Abella et al 2020") | |
ai <- c(24, | |
11, | |
58, | |
4) | |
ci <- c(37, | |
9, | |
39, | |
4) | |
n1i <- c(958, | |
414, | |
989, | |
52) | |
n2i <- c(1042, | |
407, | |
494, | |
51) | |
dat <- data.frame(author, ai, ci, n1i, n2i) | |
dat <- escalc(measure="RR", ai=ai, ci=ci, n1i=n1i, n2i=n2i, data=dat) | |
### random-effects model | |
res <- rma(yi, vi, data=dat, slab=paste(author)) | |
res | |
### average risk ratio with 95% CI | |
predict(res, transf=exp) | |
forest(res, atransf=exp) | |
reporter(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
2 Oct 2020 | Added the automatic report generated by metafor