knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(metafor)
dat <- escalc(measure="RR", ai=c(3, 5, 2, 0, 1), bi=c(32, 39, 43, 15, 24), ci=c(6, 7, 4, 1, 2), di=c(29, 35, 41, 14, 23), slab=c("Mahmoud et al, 2017", "Li et al (Standard), 2020", "Li et al (OLA), 2020", "Ammar et al, 2021", "Yao et al, 2020"))
pm <- rma(yi, vi, data=dat, method="PM") forest(pm, atransf=exp, at=log(c(0.01, 0.1, 0.5, 1, 4, 10)))
These results agree with the paper (Fig 2, top).
fe <- rma(yi, vi, data=dat, method="FE") forest(fe, atransf=exp, at=log(c(0.01, 0.1, 0.5, 1, 4, 10)))
Note: The standard RE model without HKSJ modification is identical (not shown):
re <- rma(yi, vi, data=dat, method="REML")
pmhk <- rma(yi, vi, data=dat, method="PM", test="knha") forest(pmhk, atransf=exp, at=log(c(0.01, 0.1, 0.5, 1, 4, 10)))
dat.OR <- escalc(measure="OR", ai=c(3, 5, 2, 0, 1), bi=c(32, 39, 43, 15, 24), ci=c( 6, 7, 4, 1, 2), di=c(29, 35, 41, 14, 23), slab=c("Mahmoud et al, 2017", "Li et al (Standard), 2020", "Li et al (OLA), 2020", "Ammar et al, 2021", "Yao et al, 2020"))
Results are similar:
pm.OR <- rma(yi, vi, data=dat.OR, method="PM") forest(pm.OR, atransf=exp, at=log(c(0.01, 0.1, 0.5, 1, 4, 10)))
leave1 <- leave1out(pm) forest.default(x=leave1$estimate, ci.lb=leave1$ci.lb, ci.ub=leave1$ci.ub, slab=paste("Omitting ", leave1$slab, sep=""),atransf=exp, at=log(c(0.15, 0.25, exp(pm$b), 1, 4)), xlim=log(c(0.01, 4.5)), refline=pm$b ) lines(x=log(c(1, 1)), y=c(0, 6))
The results of the leave-one-out sensitivity analysis agree with the paper (page 20, bottom, different order)
funnel(pm, main="Standard Error") regtest(pm)
results <- data.frame( ai=c(3, 5, 2, 0, 1), bi=c(32, 39, 43, 15, 24), ci=c(6, 7, 4, 1, 2), di=c(29, 35, 41, 14, 23)) results colSums(results) sum(results) library(metapower) metapower::mpower(study_size = 325, k = 5, i2 = 0, es_type = "or", test_type = "two-tailed", p = 0.05, con_table = c(11,20,153,142))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.