Re: [R] moving correlation coef ?

From: Sundar Dorai-Raj <sundar.dorai-raj_at_pdf.com>
Date: Thu 30 Jun 2005 - 00:31:54 EST

vincent wrote:
> Hello,
>
> R gives us the correlation functions cor(). (Many thanks ;-))
> Does it also exist a "moving correlation" coefficient ?
> (like the moving average).
> If not, could someone give me some infos or link
> on how to practically implement such a function in R.
>
> (I did search for "moving correlation" on the R homepage
> but didn't find anything.)
>
> Thank you.
> Vincent
>

See ?running in the gtools package:

library(gtools)
X <- rnorm(100); Y <- rnorm(100)
running(X, Y, cor)

HTH, --sundar



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jun 30 00:34:33 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:06 EST