[R-meta] Extracting residuals from rma.mv function

Viechtbauer, Wolfgang (SP) wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Mon Dec 7 08:53:37 CET 2020

Dear Rafael,

I don't understand the details of what you are trying to do, but you can obtain residuals from a 'rma.mv' model with resid(). However, that will only give you the residuals and no indication of their precision. With rstandard(), you can get get the residuals ('resid') and the corresponding standard errors ('se'). If the model you have fitted accounted for phylogenetic non-independence and differences in the precision of the effect sizes, then so will the residuals and corresponding standard errors.

However, note that residuals are not independent (that is even the case in simple regression models outside of the meta-analytic context). With:

vcov(res, type="resid")

(assuming the model object is called 'res') you can get the full var-cov matrix of the residuals. You will note that this is not a diagonal matrix. The standard errors are just the square root of the diagonal elements:

sqrt(diag(vcov(res, type="resid")))

So, whatever you intend to do with the residuals may require that you not only account for differences in their precision, but also their covariances.


>-----Original Message-----
>From: Rafael Rios Moura [mailto:biorafaelrm using gmail.com]
>Sent: Saturday, 05 December, 2020 18:26
>To: r-sig-meta-analysis using r-project.org; Viechtbauer, Wolfgang (SP)
>Subject: Extracting residuals from rma.mv function
>Dear Dr. Wolfgang and All,
>I want to extract unbiased residuals of a rma.mv function to use in a
>repeatability analysis for another random variable in the rptR package.
>Thus, I want to control for precision (or weight) for each effect size and
>phylogenetic non-independence. Which kind of residuals should be more
>appropriate to do that in a mixed-effects multilevel meta-analysis and how
>can I extract them from the rma.mv function? Any help is welcome.
>All the best,
>Prof. Dr. Rafael Rios Moura
>scientia amabilis
>Núcleo de Extensão e Pesquisa em Ecologia e Evolução (NEPEE)
>Departamento de Ciência Biológicas
>UEMG Ituiutaba
>ORCID: http://orcid.org/0000-0002-7911-4734
>Currículo Lattes: http://lattes.cnpq.br/4264357546465157
>Research Gate: https://www.researchgate.net/profile/Rafael_Rios_Moura2
>Rios de Ciência: https://www.youtube.com/channel/UCu2186wIJKji22ai8tvlUfg

More information about the R-sig-meta-analysis mailing list