# [R-meta] Calculating covariances in multivariate meta-analysis

Viechtbauer Wolfgang (SP) wolfgang.viechtbauer at maastrichtuniversity.nl
Wed Jan 17 22:09:48 CET 2018

Indeed, the computations are a *huge* pain. I wrote this a while ago:

https://gist.github.com/wviechtb/700983ab0bde94bed7c645fce770f8e9

It will go into metafor at some point.

Best,
Wolfgang

-----Original Message-----
From: R-sig-meta-analysis [mailto:r-sig-meta-analysis-bounces at r-project.org] On Behalf Of Mark White
Sent: Wednesday, 17 January, 2018 19:03
To: James Pustejovsky
Cc: r-sig-meta-analysis at r-project.org
Subject: Re: [R-meta] Calculating covariances in multivariate meta-analysis

James,

Thank you—I have looked at that citation (and similar ones mentioned in the
documentation for metafor::rma.mv); yes, they do appear to be somewhat of a
pain.

The goal here is simple: All I want is the overall, meta-analytic
correlation and confidence interval. That is, a multivariate estimate for y
~ 1 (i.e., metafor::rma.mv(yi, V)).

Mark

On Wed, Jan 17, 2018 at 11:30 AM, James Pustejovsky <jepusto at gmail.com>
wrote:

> Mark,
>
> The formulas needed to calculate the covariances are given in the
> following reference:
>
> Olkin, I., & Finn, J. (1990). Testing correlated correlations.
>> Psychological Bulletin, 108(2), 330–333.
>
>
> Unfortunately they're a bit complicated, a pain in the rear to program,
> and sometimes return non-positive definite covariance matrices that create
> problems at the meta-analysis stage. If you've got the raw data, a cleaner
> approach would be to use a basic bootstrap (i.e., re-sampling cases) for
> the set of correlations you want to meta-analyze.
>
> But a larger question might be relevant here: what is the goal of
> conducting a multi-variate meta-analysis on these correlations? Is it to
> come up with a synthetic correlation matrix? To understand heterogeneity
> across studies in the correlations? Depending on your answer--and given
> that you have access to the raw data--other statistical approaches (other
> than MV meta-analysis) might be equally or better suited for the problem.
>
> James
>
> On Wed, Jan 17, 2018 at 9:17 AM, Mark White <markhwhiteii at gmail.com>
> wrote:
>
>> Hello all,
>>
>> I have 8 studies in my dissertation; I want to meta-analyze the
>> correlation
>> between focal variable X and outcome Y. Let variables for Study 1 be x1
>> and
>> y1, Study 2 be x2 and y2, etc. However, I also have *various measurements
>> *of
>> each construct in some studies. For example, in Study 1, I have the
>> correlation between x1_1 and y1_1, as well as x1_2 and y1_2. And in Study
>> 2, I have the correlation between x2_1 and y2_1 as well as x2_2 and y2_2.
>> In Study 3, I have these all the way up to x3_10 and y3_10.
>>
>> I want to perform a multivariate meta-analysis, since I have all of the
>> raw
>> data. My question: How do I calculate the covariates between these
>> correlations? I know I want to end up with a covariance matrix where the
>> diagonal is the variance, off-diagonal the covariances (with all zeros
>> where they are from different studies). In the analysis examples on the
>> metafor website, these are already calculated for the user. How do I
>> calculate these from my raw data?
>>
>> Thank you,
>> Mark