Re: [R] finding correlation for lagged values

2012-08-01 Thread R. Michael Weylandt
? ccf Best, Michael On Wed, Aug 1, 2012 at 7:46 AM, arunkumar wrote: > 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 th

[R] finding correlation for lagged values

2012-08-01 Thread arunkumar1111
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