0
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ which formulas you have used for computing correlation before and after "transformation". $\endgroup$ – Subhash C. Davar Nov 14 '16 at 18:11
  • $\begingroup$ I used the command corr in stata for both pre- and post-transformation. $\endgroup$ – Mataunited17 Nov 14 '16 at 18:34
  • $\begingroup$ I suspect percentage change amounts to data-transformation. And it can not be a cause for negative correlation. $\endgroup$ – Subhash C. Davar Nov 14 '16 at 18:44
  • 1
    $\begingroup$ 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. $\endgroup$ – whuber Nov 14 '16 at 20:41
  • 1
    $\begingroup$ 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. $\endgroup$ – whuber Nov 14 '16 at 22:02
1
$\begingroup$

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

enter image description here

#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()

enter image description here

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

enter image description here

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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