# Use p-values to weight correlations before combining them

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)
}

• What for? How exactly do you want to weight correlation by p-value? – Tim Nov 18 '16 at 9:52
• – user83346 Nov 18 '16 at 10:20
• @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 = ?) – llrs Nov 18 '16 at 10:34
• @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. – Tim Nov 18 '16 at 10:42
• 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 – llrs Nov 18 '16 at 11:18

• 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? – llrs Nov 18 '16 at 15:08
• 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. – gung - Reinstate Monica Nov 18 '16 at 15:16