Closed SBCV closed 4 years ago
Hi Sebastian,
You can use an rma object as input to metagen()
. E.g.,
library(meta)
data(Olkin95)
dat <- subset(Olkin95, year < 1970)
m4 <- metafor::rma(ai = event.e, bi = n.e - event.e,
ci = event.c, di = n.c - event.c,
measure = "OR", data = dat, slab = author)
m <- metagen(m4$yi, sqrt(m4$vi), studlab = m4$slab, sm = m4$measure,
comb.fixed = m4$method == "FE", comb.random = m4$method != "FE",
method.tau = ifelse(m4$method == "FE", "DL", m4$method),
hakn = m4$test == "hakn")
# Same results
m4
print(summary(m), backtransf = FALSE, digits.Q = 4)
# Forest plot
forest(m, leftcols = "studlab", leftlab = "Author", hetlab = "")
Note, I2 values are slightly different as meta and metafor use different calculation methods (see https://stat.ethz.ch/pipermail/r-sig-meta-analysis/2019-May/001544.html).
Best wishes, Guido
Thank you for the fast response!
I've (already) conducted a meta analysis with the
metafor
package. Now, I've discovered themeta
package and realized that themeta::forest()
function creates way better forest plots than the corresponding function in themetafor
package.I've read that the
meta
package uses themetafor
package internally. So, I'm wondering, if there is a convenient way to cast themetafor::rma
objects to objects of typemeta::meta
(which are required as input ofmeta::forest()
)?Best regards, Sebastian