s-news
[Top] [All Lists]

Query: generalising tapply to calculate cross sectional correlati ons

To: s-news@lists.biostat.wustl.edu
Subject: Query: generalising tapply to calculate cross sectional correlati ons
From: Glenn.Treacy@ILIM.COM
Date: Thu, 25 Nov 2004 17:51:23 -0000
Hi,

I would be surprised if there is not a very neat way of doing this in S+ but
I'm stuck.

I have a data frame with a number of observations at each time point and
several attributes for each observation. At each point in time these
attributes are ranked and I want to get the cross correlation at each point
in time. My first effort was

tapply(jj.df$RANK1, list(jj.df$DATE),cor, y=jj.df$RANK2)

This doesn't work because RANK2 has not been segmented by jj.df$DATE where
jj.df$RANK1 has. Any pointers would be greatly appreciated.

Regards,
Glenn Treacy


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept 
for the presence of computer viruses.
**********************************************************************


<Prev in Thread] Current Thread [Next in Thread>
  • Query: generalising tapply to calculate cross sectional correlati ons, Glenn . Treacy <=