I have a correlation between two dimensions $A$ and $B$, each dimension has 1 variable $i$ with $j$ samples. $A_i$ and $B_i$ (Let's call it $r_{Di}$). I also have a correlation of $A_i$ with another variable $C_i$ (Let's say $r_{Ei}$). For each correlation I calculate the $p$-value. For these 2 correlations, I do the correlation between ($r_D$) and ($r_E$) for all the $i$ variables. As I have the $p$-values of each correlation of $A$ with $B$ and each correlation of $A$ with $C$, can I use these $p$-values to do a weighted correlation for the correlation between $r_D$ and $r_E$? If I can use the $p$-values for this correlation how do I combine them?

I could find a question (When combining p-values, why not just averaging?) which seems to imply that there are further uses of $p$-values. But the aim of such methods seems to combine different independent studies and not from the same study.

To calculate those $p$-values are calculated with this function in r package WGCNA, whose descriptions says "Calculates Student asymptotic p-value for given correlations":

function (cor, nSamples) {
    T = sqrt(nSamples - 2) * cor/sqrt(1 - cor^2)
    2 * pt(abs(T), nSamples - 2, lower.tail = FALSE)
  • $\begingroup$ What for? How exactly do you want to weight correlation by p-value? $\endgroup$
    – Tim
    Nov 18, 2016 at 9:52
  • $\begingroup$ see stats.stackexchange.com/questions/164181/… $\endgroup$
    – user83346
    Nov 18, 2016 at 10:20
  • $\begingroup$ @Tim Because the p-values indicates how much I trust a value, so for further correlations I hope that this information can be incorporated somehow. In R the package corr: w.cor(AB, AC, w = ?) $\endgroup$
    – llrs
    Nov 18, 2016 at 10:34
  • $\begingroup$ @Llopis there is no such package on CRAN so I'm not sure what do you refer to. I guess that you mean weighted correlation but if so, then the weights are per observation, not per variable, and certainly nor per pairs of variables. $\endgroup$
    – Tim
    Nov 18, 2016 at 10:42
  • $\begingroup$ Oh, I mixed names it is from the boot package. Yes, I mean weighted correlation.So I can't do the correlation between ABi ABj with ACi ACj using for each pair?, The corr function of the boot package expect this weight for each pair $\endgroup$
    – llrs
    Nov 18, 2016 at 11:18

1 Answer 1


No, you can't do that. The flaw is that p-values do not "indicate how much I trust a value". Rather, p-values can be considered a measure of evidence against the null value. Those aren't the same thing (although they do sound similar to people at first). The confidence interval could be considered a measure of how much your trust the (point) value of your correlation, but I would not use it in the way you are thinking.

I wouldn't bother trying to use a weighted correlation at all in your circumstance. Moreover, knowing the correlations between A and B, and between A and C, does very little to constrain the possible correlation value between B and C (see: If A and B are correlated with C, why are A and B not necessarily correlated?).

  • $\begingroup$ I am doing the correlation between $A_i$ and $B_i$ (let's call it $r_{Di}$) and between $A_i$ and $C_i$ (let's call it $r_{Ei}$) and I want to use the p-values of those correlations to the correlation between $r_E$ and $r_D$. In this sense the evidence against the null value wouldn't be useful? $\endgroup$
    – llrs
    Nov 18, 2016 at 15:08
  • 1
    $\begingroup$ I'm not sure I follow this, @Llopis. You've computed $r_{AB}$ & $r_{AC}$, & now you want to compute $r_{(A-B)(A-C)}$? That doesn't make sense. (1) you don't do that--that's a spurious correlation; & (2) the p-values wouldn't be relevant for that even if it did make any sense. Why do you want to do that? What is your real goal here? It might help if you provided more information about your situation, your study, your data, & what you ultimately want to know. $\endgroup$ Nov 18, 2016 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.