# Too high correlation between two variables? Does it mean that there is a multi-collinearity?

Two of the variables in my data set have very high positive correlation. By transforming the data to percentage changes and check for correlation between variables, I see that they are negatively correlated. What does this mean?

What other methods can I check for their high correlation for non-transformed data? Can I check for multicollinearity?

• which formulas you have used for computing correlation before and after "transformation". – Subhash C. Davar Nov 14 '16 at 18:11
• I used the command corr in stata for both pre- and post-transformation. – Mataunited17 Nov 14 '16 at 18:34
• I suspect percentage change amounts to data-transformation. And it can not be a cause for negative correlation. – Subhash C. Davar Nov 14 '16 at 18:44
• It sounds like you are differencing a time series. It is important to explain that in your post. Since the absolute values in the series and their annual changes are two almost completely different things, there is no reason to suppose there would be any connection between their correlations. – whuber Nov 14 '16 at 20:41
• Let's fill two pools from hoses supplied by a common source. The source pumps water at a constant rate, but the distribution of water delivered to the pools fluctuates: sometimes more goes to the first pool, sometimes more to the second. Two time series measure the volumes of water in the two pools. (a) Because the pools are being filled simultaneously, their volumes are positively correlated. (b) Because the total volume delivered per time unit is constant, any decrease in the rate at one pool corresponds to an increase in the other's rate: the rates are perfectly negatively correlated. – whuber Nov 14 '16 at 22:02

Going by the comments in the question, you should check the concept of stationarity of timeseries analysis.

Let's generate an example here, two uncorrelated series:

#Generates 101 points, applies PCA, resulting in uncorrelated series
data = prcomp(cbind(rnorm(101L), rnorm(101L)))\$x
x = data[,1L]
y = data[,2L]
t = seq(from = 0L, to = 1L, length.out = 101L)

#plot will be saved in your working directory
#getwd() #to check where it is

png("Timeseries1.png")
plot(x = t, y = x, lty = 1L, lwd = 2, type = "l", col = adjustcolor("blue", alpha = 0.8), ylim = range(c(x,y)),
main = paste("Correlation:", signif(cor(x, y), 1L)), ylab = "Series", xlab = "Time (U.A)")
lines(x = t, y = y, lty = 1L, lwd = 2, col = adjustcolor("red", alpha = 0.8))
dev.off()


#Now let's add a linear trend to each series:
x = x + 25 * t
y = y + 10 * t

png("Timeseries2.png")
plot(x = t, y = x, lty = 1L, lwd = 2, type = "l", col = adjustcolor("blue", alpha = 0.8), ylim = range(c(x,y)),
main = paste("Correlation:", signif(cor(x, y), 1L)), ylab = "Series", xlab = "Time (U.A)")
lines(x = t, y = y, lty = 1L, lwd = 2, col = adjustcolor("red", alpha = 0.8))
dev.off()


See? The correlation is all due to the trend. Or, in other words, removing the trend would reveal there's no correlation between series. We could do this to any arbitrary correlation we wanted. Taking percentual change is, effectively, accounting for the trend in the series.

#The percentual change
x = diff(x)/x[1:100] * 100
y = diff(y)/y[1:100] * 100

png("Timeseries3.png")
plot(x = t[2:101], y = x, lty = 1L, lwd = 2, type = "l", col = adjustcolor("blue", alpha = 0.8), ylim = range(c(x,y)),
main = paste("Correlation:", signif(cor(x, y), 1L)), ylab = "Percentual change in series (%)", xlab = "Time (U.A)")
lines(x = t[2:101], y = y, lty = 1L, lwd = 2, col = adjustcolor("red", alpha = 0.8))
dev.off()


But the percentual change still isn't stationary: the fluctuations are higher at the beginning due to the fact the amplitudes of the series are smaller there.