Re: [R] Correlation, by date, of two variables?

From: t c <quantpm_at_yahoo.com>
Date: Thu 13 Oct 2005 - 05:01:56 EST

I have a dataset with three variables: date, var1, var2  

How can I calculate the correlation, by date, between var1 and var2?

e.g.

date var1 var2

1/1/2001    5    4
1/1/2001    8    5
1/1/2001    9    7

 

2/1/2001    7    2

2/1/2001 2 1
2/1/2001 4 6  
3/1/2001    3    5
3/1/2001    4    3
3/1/2001    6    9
3/1/2001    7    -1

 

the results I want:

1/1/2001 0.891042111
2/1/2001 0.075093926
3/1/2001 -0.263117406



		
---------------------------------

	[[alternative HTML version deleted]]

______________________________________________
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 Oct 13 05:19:31 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:42 EST