<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Dear Michael,</p>
    <p>but how do I test if the effect of factor levels X vs Y (leaving
      out Z) is moderated by my continuous covariate? I believe that
      metafor gives me several ways to test for an overall interaction
      between a factor and a continuous covariate, but I'm not sure how
      I'd do follow-up comparisons from there.</p>
    <p>Best,</p>
    <p>Anna-Lena<br>
    </p>
    <br>
    <div class="moz-cite-prefix">Am 17.08.2018 um 14:44 schrieb Michael
      Dewey:<br>
    </div>
    <blockquote type="cite"
      cite="mid:2ccc0022-a1d2-b5f8-2395-c076962ded54@dewey.myzen.co.uk">Dear
      Anna-Lena
      <br>
      <br>
      The concept of interaction works generally for factor by factor,
      factor by covariate, and covariate by covariate. So you can just
      go ahead. I must say I have always found it harder to explain the
      covariate by covariate ones but that may be a defect in my
      explanatory powers.
      <br>
      <br>
      Michael
      <br>
      <br>
      On 17/08/2018 12:43, Anna-Lena Schubert wrote:
      <br>
      <blockquote type="cite">Dear Wolfgang,
        <br>
        <br>
        thank you so much, this works perfectly well for me!
        <br>
        <br>
        I have one final questions before I'm ready to analyze my data:
        Could I check whether this moderation by variable type is
        moderated by study characteristics? I.e., is there a way to
        include an interaction term that again specifically tests if
        moderator M moderates the difference in correlations between X
        and Y? I found your example on two categorial moderates and
        think I could apply that, but most of the moderators I'm
        thinking about are metric variables.
        <br>
        <br>
        Best,
        <br>
        <br>
        Anna-Lena
        <br>
        <br>
        <br>
        Am 15.08.2018 um 14:50 schrieb Viechtbauer, Wolfgang (SP):
        <br>
        <blockquote type="cite">library(metafor)
          <br>
          <br>
source(<a class="moz-txt-link-rfc2396E" href="https://gist.githubusercontent.com/wviechtb/700983ab0bde94bed7c645fce770f8e9/raw/5bb5601852b132af533aef41405d58a3ae04cf82/rmat.r">"https://gist.githubusercontent.com/wviechtb/700983ab0bde94bed7c645fce770f8e9/raw/5bb5601852b132af533aef41405d58a3ae04cf82/rmat.r"</a>)
          <br>
          <br>
          dat <- read.table(header=TRUE, text = "
          <br>
          study    var1 var2  ri  ni
          <br>
               1    X    Y    .20  50
          <br>
               1    X    Z    .30  50
          <br>
               1    Y    Z    .52  50
          <br>
               2    X    Y    .34  35
          <br>
               2    X    Z    .43  35
          <br>
               2    Y    Z    .44  35")
          <br>
          <br>
          dat2 <- rmat(ri ~ var1 + var2 | study, n=c(50,35),
          data=dat)
          <br>
          dat2
          <br>
          <br>
          res <- rma.mv(yi, dat2$V, mods = ~ var1var2 - 1, random = ~
          var1var2 | id, struct="UN", data=dat2$dat)
          <br>
          res
          <br>
          <br>
          ### three contrasts
          <br>
          anova(res, L=c(1, -1, 0))
          <br>
          anova(res, L=c(1, 0, -1))
          <br>
          anova(res, L=c(0, 1, -1))
          <br>
          <br>
          You are interested in the first of these three contrasts, that
          is, whether cor(X,Y) = cor(X,Z).
          <br>
          <br>
          Actually, I would recommend to work with:
          <br>
          <br>
          dat2 <- rmat(ri ~ var1 + var2 | study, n=c(50,35),
          data=dat, rtoz=TRUE)
          <br>
          dat2
          <br>
          <br>
          This applies Fisher's r-to-z transformation.
          <br>
          <br>
          Best,
          <br>
          Wolfgang
          <br>
          <br>
          -----Original Message-----
          <br>
          From: Anna-Lena Schubert
          [<a class="moz-txt-link-freetext" href="mailto:anna-lena.schubert@psychologie.uni-heidelberg.de">mailto:anna-lena.schubert@psychologie.uni-heidelberg.de</a>]
          <br>
          Sent: Wednesday, 15 August, 2018 11:08
          <br>
          To: Viechtbauer, Wolfgang
          (<a class="moz-txt-link-abbreviated" href="mailto:SP);r-sig-meta-analysis@r-project.org">SP);r-sig-meta-analysis@r-project.org</a>
          <br>
          Subject: Re: [R-meta] Comparing dependent, overlapping
          correlation coefficients
          <br>
          <br>
          Hi Wolfgang,
          <br>
          <br>
          thanks so much, I now believe I have sensible values in my V
          matrix.
          <br>
          They deviate slightly from manual calculations, but are really
          close.
          <br>
          <br>
          I'm still lost on how to test for the interaction between X
          and Y then,
          <br>
          though. I tried
          <br>
          <br>
                   res <- rma.mv(yi, V, mods = ~ variable | studyID,
          data=dat,
          <br>
          method="ML"),
          <br>
          <br>
          but the results don't correspond to the univariate
          meta-analyses I
          <br>
          conducted before. In addition, it tests (I believe) for a
          moderation of
          <br>
          all three correlations, while I'm only interested in the
          difference
          <br>
          between r_XY and r_XZ. Moreover, the manual says "In case the
          sampling
          <br>
          errors are correlated, then one can specify the entire
          <br>
          variance-covariance matrix of the sampling errors via the V
          argument",
          <br>
          but it seems I cannot simply leave "yi" out of the argument.
          <br>
          <br>
          Best, Anna-Lena
          <br>
          <br>
          Am 14.08.2018 um 22:18 schrieb Viechtbauer, Wolfgang (SP):
          <br>
          <blockquote type="cite">You do not need escalc(). The rmat()
            function gives you the variances along the diagonal of the
            'V' matrix.
            <br>
            <br>
            The variances should be (1 - ri^2)^2 / (ni - 1). You should
            be able to double-check that these values correspond to your
            data. Since ni should be the same for r_XY and r_XZ within a
            study, then it might be that the variances are roughly the
            same if the two correlations are not all that different.
            They should not be identical though (unless r_XY and r_XZ
            are the same).
            <br>
              Best,
            <br>
            Wolfgang
            <br>
            <br>
            -----Original Message-----
            <br>
            From: R-sig-meta-analysis
            [<a class="moz-txt-link-freetext" href="mailto:r-sig-meta-analysis-bounces@r-project.org">mailto:r-sig-meta-analysis-bounces@r-project.org</a>] On Behalf
            Of Anna-Lena Schubert
            <br>
            Sent: Tuesday, 14 August, 2018 14:20
            <br>
            To: James Pustejovsky
            <br>
            <a class="moz-txt-link-abbreviated" href="mailto:Cc:r-sig-meta-analysis@r-project.org">Cc:r-sig-meta-analysis@r-project.org</a>
            <br>
            Subject: Re: [R-meta] Comparing dependent, overlapping
            correlation coefficients
            <br>
            <br>
            Hi James,
            <br>
            I used Wolfgang's script on git to calculate the Cov(r_XY,
            r_XZ) by feeding it Cor(r_YZ). In the next step, I
            calculated Var(r_XY) and Var(r_XZ) by using the escalc
            function. However, Var(r_XY) always equals Var(r_XZ) for
            each study. Does this make sense?
            <br>
            I nevertheless added all three measures per study into a
            variance-covariance matrix such as:
            <br>
                             r_XY r_XZ    r_XY r_XZ
            <br>
            r_XY        0.004    0.0001    0    0
            <br>
            r_XZ        0.0001    0.004    0    0
            <br>
            r_XY        0    0    0.008    0.002
            <br>
            r_XZ        0    0    0.002    0.008
            <br>
            Then, I tried to feed everything into a multivariate
            meta-analysis:
            <br>
                 res <- rma.mv(yi, V, mods = ~ variableType - 1,
            random = ~ variableType | studyNum, struct="UN", data=dat,
            method="ML")
            <br>
            The estimates I get for both of the correlation coefficients
            correspond closely to those I get when only meta-analyzing
            one of the variable types, which seems great. However, I'm
            still somewhat concerned that Var(r_XY) = Var(r_XZ). Do you
            think there may have been some mistake in my code or does it
            make sense that these variances are equal?
            <br>
            Best,
            <br>
            Anna-Lena
            <br>
                         Am 10.08.2018 um 17:06 schrieb James
            Pustejovsky:
            <br>
            Anna-Lena,
            <br>
            <br>
            The approach that you suggested (putting the data in "long"
            format and defining an indicator variable for whether Y or Z
            is the correlate) is just what I would recommend. However,
            there is a complication in that the estimates r_XY and r_XZ
            are correlated (correlated correlation coefficients...say
            that six times fast!), and the degree of correlation depends
            on r_YZ.
            <br>
            <br>
            1) If you have extracted data on r_YZ then you could use
            this to compute Cov(r_XY, r_XZ) and then do a multivariate
            meta-analysis. See discussion here:
            <br>
<a class="moz-txt-link-freetext" href="https://stat.ethz.ch/pipermail/r-sig-meta-analysis/2018-January/000483.html">https://stat.ethz.ch/pipermail/r-sig-meta-analysis/2018-January/000483.html</a>
            <br>
            And this function for computing the required covariance
            matrices:
            <br>
<a class="moz-txt-link-freetext" href="https://gist.github.com/wviechtb/700983ab0bde94bed7c645fce770f8e9">https://gist.github.com/wviechtb/700983ab0bde94bed7c645fce770f8e9</a>
            <br>
            There are at least three further alternatives that might be
            simpler:
            <br>
            <br>
            2) If you have r_YZ you could use it to compute the sampling
            variance of the difference between r_XY and r_XZ, that is:
            <br>
            <br>
            Var(r_XY - r_XZ) = Var(r_XY) + Var(r_XZ) - 2 * Cov(r_XY,
            r_XZ)
            <br>
            <br>
            You could then do a univariate meta-analysis on the
            difference between correlations.
            <br>
            <br>
            3) If you do not have r_YZ then you won't be able to
            estimate Cov(r_XY, r_XZ) very well. You could make a guess
            about r_YZ and then follow approach (1) or (2) above, using
            cluster-robust variance estimation to account for the
            possibly mis-estimated sampling-variance covariance matrix.
            <br>
            <br>
            4) Or you could ignore the covariance between r_XY and r_XZ
            entirely, fit the model to the long data as you describe
            above, and use cluster-robust variance estimation
            (clustering by sample) to account for the dependence between
            r_XY and r_XZ. This is the quickest and dirtiest approach,
            and the first thing I would try in practice before moving on
            to the more refined approaches above.
            <br>
            <br>
            James
            <br>
              On Fri, Aug 10, 2018 at 9:21 AM Anna-Lena
            Schubert<a class="moz-txt-link-rfc2396E" href="mailto:anna-lena.schubert@psychologie.uni-heidelberg.de"><anna-lena.schubert@psychologie.uni-heidelberg.de></a> 
            wrote:
            <br>
            Dear all,
            <br>
            <br>
            I want to run a meta-analysis that compares dependent,
            overlapping
            <br>
            correlation coefficients (i.e., I want to see if X
            correlates more
            <br>
            strongly with Y than it does with Z). I already ran a
            meta-analysis
            <br>
            separately for both of these correlations and would now like
            to compare
            <br>
            those two pooled effect sizes statistically. Confidence
            intervals of the
            <br>
            two correlations do not overlap (r1 = .18 [.12; .24]; r2 =
            .32 [.25;
            <br>
            .39]), but I wonder if there may be a more elegant way to
            compare these
            <br>
            correlations than just based on CIs.
            <br>
            <br>
            I wonder, for example, if a factorial variable could be used
            to identify
            <br>
            those correlations in a "long" data format style, and if I
            could test
            <br>
            for a significant interaction between variable type (Y vs.
            Z) and the
            <br>
            correlation in a meta-analysis:
            <br>
            <br>
                 Study    Variable    r
            <br>
                 1    Y    .20
            <br>
                 1    Z    .30
            <br>
                 2    Y    .34
            <br>
                 2    Z    .43
            <br>
            <br>
            I would greatly appreciate if anyone could tell me if that's
            a good idea
            <br>
            or could recommend other approaches. Thanks in advance for
            any offers of
            <br>
            help!
            <br>
            <br>
            Best,
            <br>
            Anna-Lena
            <br>
          </blockquote>
        </blockquote>
        <br>
        -- <br>
        Signatur
        <br>
        <br>
        <br>
              Dr. Anna-Lena Schubert
        <br>
        <br>
        Postdoc at Section of Personality
        <br>
        Heidelberg University - Institute of Psychology
        <br>
        <br>
        Hauptstraße 47-51
        <br>
        D-69117 Heidelberg Germany
        <br>
        <br>
        Phone: +49 6221 54 7746
        <br>
        <a class="moz-txt-link-abbreviated" href="mailto:Mail:anna-lena.schubert@psychologie.uni-heidelberg.de">Mail:anna-lena.schubert@psychologie.uni-heidelberg.de</a>
        <br>
Web:<a class="moz-txt-link-freetext" href="http://www.psychologie.uni-heidelberg.de/ae/diff/diff/people-schubert.html">http://www.psychologie.uni-heidelberg.de/ae/diff/diff/people-schubert.html</a>
        <br>
        <br>
        <br>
        <br>
        _______________________________________________
        <br>
        R-sig-meta-analysis mailing list
        <br>
        <a class="moz-txt-link-abbreviated" href="mailto:R-sig-meta-analysis@r-project.org">R-sig-meta-analysis@r-project.org</a>
        <br>
        <a class="moz-txt-link-freetext" href="https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis">https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis</a>
        <br>
        <br>
      </blockquote>
      <br>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <title>Signatur</title>
      <style type="text/css">
.auto-style1 {
        font-weight: normal;
}
.auto-style2 {
        font-weight: normal;
        font-family: Arial;
        border-bottom-style: solid;
        border-bottom-width: 1px;
        padding-bottom: 1px;
}
.auto-style3 {
        font-family: Arial, Helvetica, sans-serif;
}
.auto-style4 {
        font-size: small;
}
</style>
      <h3 class="auto-style2">Dr. Anna-Lena Schubert</h3>
      <p style="line-height: 1;"><img
          src="cid:part1.3E5F5161.BED05907@psychologie.uni-heidelberg.de"
          data-filename="Logo_Diff.png" style="width: 215.5px; float:
          right; height: 49.9136px;"><font class="auto-style3"><span
            class="auto-style1"><span class="auto-style4">Postdoc at
              Section of Personality</span><br class="auto-style4">
            <span class="auto-style4">Heidelberg University - Institute
              of Psychology</span></span></font></p>
      <pre style="line-height: 1;">Hauptstraße 47-51
<span style="line-height: 1;">D-69117 Heidelberg 
</span><span style="line-height: 1;">Germany</span></pre>
      <pre style="line-height: 1;">Phone: +49 6221 54 7746
Mail: <a class="moz-txt-link-abbreviated" href="mailto:anna-lena.schubert@psychologie.uni-heidelberg.de">anna-lena.schubert@psychologie.uni-heidelberg.de</a>
Web: <a class="moz-txt-link-freetext" href="http://www.psychologie.uni-heidelberg.de/ae/diff/diff/people-schubert.html">http://www.psychologie.uni-heidelberg.de/ae/diff/diff/people-schubert.html</a></pre>
    </div>
  </body>
</html>