[R-meta] cooks.distance.rma.mv is slow on complex models
Martineau, Roger
Roger.Martineau at AGR.GC.CA
Tue Jul 25 18:56:12 CEST 2017
Dear metafor users,
I am running complex models using rma.mv function of metafor (metafor_2.0-0; R version 3.4.0) on a large dataset (n = 197 studies) with a 4-level hierarchical structure of data.
#### Model ####
(tmp.casdiet <- rma.mv(MTPYMean, MTPYSEMtrDP^2, data=tmp.dat.MTPY.new,
mods = ~
cMPbal +
cNELbal +
cMPsupply.kg +
factor(CasDiet)*cMPsupply.kg,
random = ~1|laboratory/experiment/study,
method = "REML", sparse=TRUE))
All metafor functions run well except cooks.distance.rma.mv which is really slowing my work. I have a new computer that should be up to the task.
The time spent to execute the task is related to the random statement:
· random = ~1|laboratory/experiment/study : 14 min 5 sec
· random = ~1|experiment/study : 8 min 10 sec
· random = ~1|study: 1 min 12 sec
Find below more info on variance components and Cook’s distance graphs.
In this model it wouldn’t make much of a difference to run the cooks.distance.rma.mv function with random = ~1|study but it is not the correct way to detect influential cases.
Is there another way to speed up the process ?
Thanks in advance,
Roger Martineau ☺
The variance components and the associated Cook’s distance graphs are:
Variance Components:
estim sqrt nlvls fixed
sigma^2.1 178.9385 13.3768 21 no
sigma^2.2 409.8262 20.2442 47 no
sigma^2.3 0.0000 0.0016 69 no
factor
sigma^2.1 laboratory
sigma^2.2 laboratory/experiment
sigma^2.3 laboratory/experiment/study
#### Cook's distance ####
par(mfrow=c(1,1))
tmp.cook <- cooks.distance.rma.mv(tmp.casdiet, progbar=TRUE)
plot(tmp.cook, type="o", pch=19)
which(tmp.cook > 1)
· random = ~1|laboratory/experiment/study
[cid:image007.jpg at 01D30545.643B8160]
· random = ~1|experiment/study
[cid:image008.jpg at 01D30545.643B8160]
· random = ~1|study
[cid:image009.jpg at 01D30545.643B8160]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20170725/fc88712e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.jpg
Type: image/jpeg
Size: 15148 bytes
Desc: image007.jpg
URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20170725/fc88712e/attachment-0003.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image008.jpg
Type: image/jpeg
Size: 15098 bytes
Desc: image008.jpg
URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20170725/fc88712e/attachment-0004.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image009.jpg
Type: image/jpeg
Size: 15186 bytes
Desc: image009.jpg
URL: <https://stat.ethz.ch/pipermail/r-sig-meta-analysis/attachments/20170725/fc88712e/attachment-0005.jpg>
More information about the R-sig-meta-analysis
mailing list