[R-meta] Performance of metafor::vcalc() vs clubSandwich::impute_covariance_matrix()

Tamar Novetsky t@m@r @end|ng |rom growprogre@@@@|
Tue Aug 6 15:20:08 CEST 2024


Hello,

I am working on a script to run multiple meta-regressions on different
subsets of the same dataset, and have been
using clubSandwich::impute_covariance_matrix() to generate the
variance-covariance matrix necessary as an input to metafor::rma.mv().
However, I recently learned that impute_covariance_matrix() has been
superseded by metafor::vcalc(), so I have been working to replace my usage
of the former function with the latter. In that process, I discovered that
vcalc() seems to be much slower than impute_covariance_matrix() - about
150x slower in one use case that I benchmarked using the microbenchmark
package. Since I will be running this many times in a loop, performance
matters quite a lot to me in this context.

Can anyone help me understand why vcalc() would be so much slower? Is it
possible that I'm using it incorrectly?

Secondly/possibly relatedly, I found that the results from vcalc() are
always either exactly the same or exactly double the results from
impute_covariance_matrix(). Does anyone have a sense of why that would be?
Could that be related to the performance differences?

Thanks so much for your help,


*Tamar Novetsky* *(she/her)*
Data Scientist I
Eastern Time Zone

	[[alternative HTML version deleted]]



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