# Correlation of a calculated variable

This might be a very basic question, but I've failed in finding an explanation on the web ...

How is it possible that a variable (Var1) that significantly correlates with two different variables (Var2 and Var3), would not correlated also with a fourth variable (Var4) which is the result of dividing the later two variables (Var4 = Var2/Var3)?

For example: I have an image in which one of the properties is "Quality". I use this image to obtain two measurements: $M_1$ and $M_2$. From $M_1$ and $M_2$ I calculate $F_1$ (which is my endpoint) by dividing $M_1$ by $M_2$ ($F_1 = M_1/M_2$).

Although I get a significant correlation between "Quality" to both $M_1$ and $M_2$ (Spearman's -0.625, P<0.0001 and -0.636, P<0.0001 respectively), the correlation between $F_1$ and "Quality" is non-significant (-0.095, p=0.565). It should also be noted that $M_1$ and $M_2$ strongly correlate with each other (0.692, P<0.0001).

• Since correlation measures a degree of linearity in a relationship and division can be arbitrarily non-linear, we should be surprised if there were any general relationship among correlations involving fractions. If you can bound the values of the numerator and denominator (such as when the denominator is large and positive), then perhaps something can be said--but only because in that circumstance division is approximately linear. These considerations provide hints concerning how to construct illustrative examples. – whuber Jul 27 '16 at 22:18
• Thank you very much. Just to be clear, if I can say for certain that both numerator and denominator are positive (but I can't know which is bigger) would it be considered to be approximately linear? – Ari Leshno Jul 28 '16 at 6:19

## 2 Answers

Well, the most simple (and extreme) example of this would be if all those variables are the same. If $X_1 = X_2 = X_3$ then we have $X_2/X_3 = 1$, which is constant, so that:

\begin{equation} \begin{aligned} \mathbb{Corr}(X_1,X_2) &= 1, \\[6pt] \mathbb{Corr}(X_1,X_3) &= 1, \\[6pt] \mathbb{Corr}(X_1,X_2/X_3) &= 0. \\[6pt] \end{aligned} \end{equation}

As you can see, in this extreme case the value $X_1$ has perfect correlation with $X_2$ and $X_3$, but zero correlation with their ratio $X_2/X_3$. So this kind of phenomenon is certainly possible in the mathematical sense described here. In this case you can see that the correlation with the individual variables is "cancelled out" in the correlation with the ratio variable.

Practically speaking, in your particular analysis I notice that $\widehat{\mathbb{Corr}}(X_1,X_2) \approx \widehat{\mathbb{Corr}}(X_1,X_3)$ and you also find no significant evidence of correlation with the ratio of these two latter variables. It is possible that the correlation in the individual variables is "cancelling out" in the ratio in a manner roughly analogous to the above extreme example. You can probably see exactly what is going on by generating a scatterplot matrix of your data, including the ratio variable.

The clue is in your last sentence "It should also be noted that $M_1$ and $M_2$ strongly correlate with each other". In the limit case where that correlation is 1, $F_1=M_1/M_2$ will be a constant, and the correlation of a constant with anything is zero. When it is only strong, $F_1$ will be close to constant, so with low variance and the correlation close to zero.

Let us look at that with some simulation. I will denote the Quality variable by $Q$. Simulation in R with correlations similar to yours:

library(MASS)
set.seed(7*11*13) # my public seed

n  <-  100
mu <-  c(100,20,20)
sd1 <- 7
sd2 <- sd3 <- 3
rho1 <- -0.5
rho2 <- 0.7
Sigma <- matrix( c(sd1^2, sd1*sd2*rho1, sd1*sd2*rho1, sd1*sd2*rho1, sd2^2, sd2*sd2*rho2, sd1*sd2*rho1, sd2*sd2*rho2, sd2^2), 3, 3)

mydata     <- mvrnorm(n, mu, Sigma) # returns samples in rows
mydata  <- cbind(mydata, mydata[,2] / mydata[,3] )
colnames(mydata)  <-  c("Q","M_1","M_2","F_1")

cor(mydata)
Q        M_1        M_2         F_1
Q    1.00000000 -0.6777416 -0.6635441 -0.02183251
M_1 -0.67774159  1.0000000  0.6928511  0.39089309
M_2 -0.66354405  0.6928511  1.0000000 -0.37940807
F_1 -0.02183251  0.3908931 -0.3794081  1.00000000


Note the very small correlation (about -0.02) between $F_1$ and $Q$. You can repeat the simulation yourself with other parameters.

Some other views was given in a comment by whuber: "Since correlation measures a degree of linearity in a relationship and division can be arbitrarily non-linear, we should be surprised if there were any general relationship among correlations involving fractions. If you can bound the values of the numerator and denominator (such as when the denominator is large and positive), then perhaps something can be said--but only because in that circumstance division is approximately linear. These considerations provide hints concerning how to construct illustrative examples. "