I am trying to calculate lagged Pearson correlation coefficient between time series. I am not interested in calculating cross-correlation. I want to calculate Pearson correlation coefficient because I want to use the correlation for prediction.
In general, when two variables are strongly correlated, we get a high correlation coefficient. We can fit a straight line in the scatter plot of the two variables and use it for predicting $y$ (based on $x$). In such a case, the variance explained by the fitted line would be equal to the square of the correlation coefficient.
But when the two variables are arranged in a certain lag and then Pearson correlation coefficient is calculated between them, can we still say that the variance explained will be equal to the square of the correlation coefficient? Can we use the best fit line from the lagged scatter plot for prediction?
cor
function itself can treatNA
values differently; type?cor
in R for details. $\endgroup$