[R] finding correlation for lagged values

arunkumar1111 akpbond007 at gmail.com
Wed Aug 1 14:46:16 CEST 2012


Hi

I've to find the correlation of a variable and lag of other variable.

My code currently looks like this

y= 32  1 45 26 33 55 15 24 31 78
x=51 69 96 67 71 89 61 42 78 24
lagTimes=2

 i want to find the correlation between y and Lag(x,1) and Y &Lag(x,2)

i'm using loop to find the lag and then finding correlation

If there are more variables and need to find the correlation lag with y it
takes a lot of time.

can anyone help



-----
Thanks in Advance
        Arun
--
View this message in context: http://r.789695.n4.nabble.com/finding-correlation-for-lagged-values-tp4638663.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list