Skip to content
Prev 3672 / 5636 Next

[R-meta] metafor::matreg() and its workflow

Hi Wolfgang,

Once again, thank you for the chapter and the two useful resources.
For concreteness, are the last two lines OK to use or other solutions
exist?

Many thanks,
Stefanou

set.seed(0)
dat <- dat.craft2003
dat$Xwb <- rnorm(nrow(dat),rnorm(nrow(dat),9,4),2)

tmp <- rcalc(ri ~ var1 + var2| study, ni=ni, data=dat)
V <- tmp$V
dat$var1.var2 <- tmp$dat$var1.var2

dat$var1.var2 <- factor(dat$var1.var2,
                        levels=c("acog.perf", "asom.perf",
"conf.perf", "acog.asom", "acog.conf", "asom.conf"))

res <- rma.mv(ri~ 0+var1.var2+sport+Xwb, V, random = ~ var1.var2 |
study, struct="UN", data=dat)

R <- vec2mat(coef(res)[1:6]) # Is this OK?

matreg(1, 2:4, R=R, V=vcov(res)[1:6,1:6]) # Is this OK?

On Sun, Dec 5, 2021 at 10:26 PM Stefanou Revesz
<stefanourevesz at gmail.com> wrote: