[R-meta] errors returned by rma() and rma.mv() when fitting a large dataset
Lukasz Stasielowicz
|uk@@z@@t@@|e|ow|cz @end|ng |rom un|-o@n@brueck@de
Thu May 23 13:03:23 CEST 2024
Dear Yefeng,
Since some of the mentioned methods tend not to perform well (Carter et
al., 2019; Renkewitz & Keiner, 2019; Rodgers & Pustejovsky, 2021), you
might also consider dropping some publication bias analyses. Using more
methods is not necessarily more informative.
Carter, E. C., Schönbrodt, F. D., Gervais, W. M., & Hilgard, J. (2019).
Correcting for Bias in Psychology: A Comparison of Meta-Analytic
Methods. Advances in Methods and Practices in Psychological Science,
2(2), 115–144. https://doi.org/10.1177/2515245919847196
Renkewitz, F., & Keiner, M. (2019). How to detect publication bias in
psychological research: A comparative evaluation of six statistical
methods. Zeitschrift Fur Psychologie, 227(4), 261–279.
https://doi.org/10.1027/2151-2604/a000386
Rodgers, M. A., & Pustejovsky, J. E. (2021). Evaluating meta-analytic
methods to detect selective reporting in the presence of dependent
effect sizes. Psychological Methods, 26(2), 141–160.
https://doi.org/10.1037/met0000300
Best,
Lukasz
--
Lukasz Stasielowicz
Osnabrück University
Institute for Psychology
Research methods, psychological assessment, and evaluation
Lise-Meitner-Straße 3
49076 Osnabrück (Germany)
Twitter: https://twitter.com/l_stasielowicz
Tel.: +49 541 969-7735
On 23.05.2024 12:00, r-sig-meta-analysis-request using r-project.org wrote:
> Send R-sig-meta-analysis mailing list submissions to
> r-sig-meta-analysis using r-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
> or, via email, send a message with subject or body 'help' to
> r-sig-meta-analysis-request using r-project.org
>
> You can reach the person managing the list at
> r-sig-meta-analysis-owner using r-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-sig-meta-analysis digest..."
>
>
> Today's Topics:
>
> 1. Re: errors returned by rma() and rma.mv() when fitting a
> large dataset (Yefeng Yang)
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 23 May 2024 02:36:20 +0000
> From: Yefeng Yang <yefeng.yang1 using unsw.edu.au>
> To: "Viechtbauer, Wolfgang (NP)"
> <wolfgang.viechtbauer using maastrichtuniversity.nl>, R Special Interest
> Group for Meta-Analysis <r-sig-meta-analysis using r-project.org>
> Subject: Re: [R-meta] errors returned by rma() and rma.mv() when
> fitting a large dataset
> Message-ID:
> <MEAPR01MB54158E32F1CB47F74A780B6A9DF42 using MEAPR01MB5415.ausprd01.prod.outlook.com>
>
> Content-Type: text/plain; charset="utf-8"
>
> Dear Wolfgang,
>
> Thank you for your swift reply.
>
> A quick update:
>
>
> *
> 1. trimfill() function in meta package also returns me the same error. This happened when I fit the RE model using metagen() function:
> metagen(TE = mu_adj, seTE = se_adj,
> studlab = id, data = dat_med,
> fixed = FALSE, random = TRUE,
> method.tau = "REML", hakn = TRUE)
> *
> I tried selection model implemented in other packages like weight:
> weightfunct(effect = dat_med$mu_adj, v = dat_med$se_adj^2, steps = c(0.025), table = TRUE)
>
> and metasens:
> metagen(mu_adj, se_adj, method.tau="ML", data=dat_med) & copas(res)
>
> Both leads to error caused by the k*k matrices. I did not try what Wolfgang suggested because I do not know how to do it:
> "If so, you could take the rma.mv results, stuff them into an object that has the structure of a rma.uni object, and then call selmodel() on that object."
>
> My ultimate aim is to test whether a dataset has publication bias. I would like to use multiple methods, like Egger's regression, selection model, trim and fill. But now it seems that I can only use Egger's regression (lm() version or rma.mv() version).
>
> What do you think if I randomly sample a certain number of estimates from my big dataset and run selection model and trim-and-fill, and I repeat this many times? Of course, 'a certain number of estimates' should not induce the matrix issue.
>
> Best regards,
> Yefeng
> ________________________________
> From: Viechtbauer, Wolfgang (NP) <wolfgang.viechtbauer using maastrichtuniversity.nl>
> Sent: 22 May 2024 20:09
> To: R Special Interest Group for Meta-Analysis <r-sig-meta-analysis using r-project.org>
> Cc: Yefeng Yang <yefeng.yang1 using unsw.edu.au>
> Subject: RE: errors returned by rma() and rma.mv() when fitting a large dataset
>
> Dear Yefeng,
>
> The problem is that quite a bit of code in metafor works with k*k matrices, where k is the number of estimates. A matrix of that size can quickly get very large, as you can tell.
>
> To fit a RE model, you can use rma.mv() with sparse=TRUE. This will avoid those large matrices. However, trimfill() and selmodel() won't work with rma.mv objects, even if they are just 'standard' RE models.
>
> I *think* (but would have to double-check very carefully) that selmodel() actually doesn't make use of k*k matrices. If so, you could take the rma.mv results, stuff them into an object that has the structure of a rma.uni object, and then call selmodel() on that object. Not very elegant, but this could be a solution. But trimfill() directly calls rma.uni() for model fitting, so this trick wouldn't work. In principle, one could spin a trimfill() version that avoids calling rma.uni() but this would take some work.
>
> Maybe you could try the 'meta' package and its trimfill() function?
>
> Best,
> Wolfgang
>
>> -----Original Message-----
>> From: R-sig-meta-analysis <r-sig-meta-analysis-bounces using r-project.org> On Behalf
>> Of Yefeng Yang via R-sig-meta-analysis
>> Sent: Wednesday, May 22, 2024 11:19
>> To: r-sig-meta-analysis using r-project.org
>> Cc: Yefeng Yang <yefeng.yang1 using unsw.edu.au>
>> Subject: [R-meta] errors returned by rma() and rma.mv() when fitting a large
>> dataset
>>
>> Dear community,
>>
>> I am trying to test publication bias using trim-and-fill and selection model in
>> metafor package. When I ran the RE model with my dataset, it returned my the
>> following error:
>>
>> Error: cannot allocate vector of size 33.8 Gb
>>
>> I tried both rma() and rma.mv() (the later also can be used to fit RE model).
>>
>> I think this was caused by the large number of data points in my dataset. My
>> dataset contains 67,393 rows (or more precisely, 67,393 paired effect size
>> estimates and sampling variance).
>>
>> Is there any solution workaround that allows me to fit a RE model with a large
>> number of effect sizes, and perform the following trim-and-fill and selection
>> model?
>>
>> Very much appreciate your comments.
>>
>> Best regards,
>> Yefeng
>
> [[alternative HTML version deleted]]
>
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> R-sig-meta-analysis mailing list @ R-sig-meta-analysis using r-project.org
> To manage your subscription to this mailing list, go to:
> https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis
>
>
> ------------------------------
>
> End of R-sig-meta-analysis Digest, Vol 84, Issue 22
> ***************************************************
More information about the R-sig-meta-analysis
mailing list