[R] finding correlation for lagged values

R. Michael Weylandt michael.weylandt at gmail.com
Thu Aug 2 00:13:35 CEST 2012


? ccf

Best,
Michael

On Wed, Aug 1, 2012 at 7:46 AM, arunkumar1111 <akpbond007 at gmail.com> 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 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.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list