[R-meta] metafor::matreg() and its workflow
Stefanou Revesz
@te|@noureve@z @end|ng |rom gm@||@com
Tue Dec 7 23:40:58 CET 2021
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 using gmail.com> wrote:
>
> Dear Wolfgang,
>
> Many thanks. I read all three resources. Regarding:
>
> "What if our rma.mv() fit has multiple (interactive) moderators, what
> should be passed as R and vcov() to matreg()?"
>
> I meant, as a general matter, if our dataset (e.g.,`dat.craft2003`),
> say, had an additional continuous moderator (Xwb) varying within and
> between studies (see below), then how could such a moderator affect
> the result of rcalc() or rma.mv() or matreg()?
>
> Apparently, the `dat` object returned by rcalc() doesn't return the
> full dataset so to use moderators like Xwb from `dat` in the
> subsequent rma.mv() call. Also, in your Rmarkdown doc (previous
> email), you use a subgroup analysis to deal with a study-level,
> categorical moderator (sport) which makes me wonder how we can deal
> with Xwb or when multiple moderators exist in the data?
>
> Thanks,
> Stefanou
>
> set.seed(0)
> dat <- dat.craft2003
> dat$Xwb <- rnorm(nrow(dat),rnorm(nrow(dat),9,4),2)
>
> On Sun, Dec 5, 2021 at 11:12 AM Viechtbauer, Wolfgang (SP)
> <wolfgang.viechtbauer using maastrichtuniversity.nl> wrote:
> >
> > Dear Stefanou,
> >
> > See below for my responses.
> >
> > Best,
> > Wolfgang
> >
> > >-----Original Message-----
> > >From: Stefanou Revesz [mailto:stefanourevesz using gmail.com]
> > >Sent: Sunday, 05 December, 2021 3:55
> > >To: R meta; Viechtbauer, Wolfgang (SP)
> > >Subject: metafor::matreg() and its workflow
> > >
> > >Dear Wolfgang,
> > >
> > >In the latest version of metafor, I realized there are a couple of new
> > >functions specifically made for correlations (that's awesome!).
> > >
> > >I understand the use of rclac() which provides the V for rma.mv(). But
> > >I'm a bit unclear why we get the vcov() from the rma.mv() fit and then
> > >input it to matreg().
> > >
> > >My questions are:
> > >
> > >1- What role does matreg() play and why not just using rma.mv()?
> >
> > matreg() is for fitting regression models based on variance-covariance and correlation matrices. Such a matrix can be obtained by conducting a meta-analysis (e.g., using rma.mv()). This all takes us into methodology that is sometimes described as MASEM (meta-analytic structural equation modeling). Maybe start with this chapter:
> >
> > Becker, B. J., & Aloe, A. (2019). Model-based meta-analysis and related approaches. In H. Cooper, L. V. Hedges, & J. C. Valentine (Eds.), The handbook of research synthesis and meta-analysis (3rd ed., pp. 339-363). New York: Russell Sage Foundation.
> >
> > to go along with:
> >
> > https://wviechtb.github.io/metafor/reference/matreg.html
> >
> > and
> >
> > https://wviechtb.github.io/meta_analysis_books/cooper2019.html#16)_Model-Based_Meta-Analysis_and_Related_Approaches
> >
> > >3- What if our rma.mv() fit has multiple (interactive) moderators,
> > >what should be passed as R and vcov() to matreg()?
> >
> > I can't really answer this question without further details. But I would suggest to first read up on the methdology itself.
> >
> > >3- Is rtoz =TRUE necessary in this workflow?
> >
> > I assume you mean argument 'ztor' in matreg(). Whether to use this depends on whether you have a matrix of r-to-z transformed correlation coefficients or a matrix of raw correlation coefficients. Whether one should or should not use transformed correlations in a meta-analysis that could yield such a matrix is a lengthy and endless debate, so I am not going to touch on "necessary" without a ten-foot pole.
> >
> > >Thank you,
> > >Stefanou
More information about the R-sig-meta-analysis
mailing list