[R-meta] Cochran's test of heterogeneity (QE) for a meta-analytic model fitted via lme()

Viechtbauer Wolfgang (SP) wolfgang.viechtbauer at maastrichtuniversity.nl
Wed Nov 29 13:59:50 CET 2017


Hi Gabri,

First of all, please note that lme() doesn't quite give the correct results with REML estimation when fitting meta-analytic models (but the discrepancy is minor/negligible). See, for example:

https://jepusto.github.io/Bug-in-nlme-with-fixed-sigma

This aside, yes, one can obtain the QE-test statistic. For this, fit the model without random effects and then compute the sum of the squared Pearson residuals. Here is an example:

library(metafor)
library(nlme)

dat <- get(data(dat.konstantopoulos2011))
res <- rma.mv(yi, vi, mods = ~ year, random = ~ 1 | district/school, data=dat)
res

res <- lme(yi ~ year, random = ~ 1 | district/school, weights = varFixed(~ vi), data=dat, control=lmeControl(sigma = 1))
summary(res) ### results are just a bit off

res0 <- gls(yi ~ year, weights = varFixed(~ vi), data=dat, control=lmeControl(sigma = 1))
sum(residuals(res0, type="pearson")^2)

This yields the exact same value of the QE-test statistic as provided by rma.mv().

Best,
Wolfgang

-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces at r-project.org] On Behalf Of Gabriele Midolo
Sent: Wednesday, 29 November, 2017 13:37
To: r-sig-meta-analysis at r-project.org
Subject: [R-meta] Cochran's test of heterogeneity (QE) for a meta-analytic model fitted via lme()

Hi,

Is it possible to perform the test for residual heterogeneity on a model
fitted with lme (nlme package) analogue to what is obtained in the rma.mv
model output?

Thanks,
Gabri



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