Re: [R] Problem: using cor.test with by( )

From: Liviu Andronic <>
Date: Sun, 30 Mar 2008 23:21:33 +0200

On Sun, Mar 30, 2008 at 7:11 PM, Che-hsu (Joe) Chang <> wrote:
> Basically, I want to calculate the correlation between variable A and B for
> every subject in my study. (yep, that simple)
> What I did is this:
> by(data, id, function (x) cor.test(A,B, data=x))

This recent thread [1] might prove of interest. Liviu

[1] mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Sun 30 Mar 2008 - 21:28:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 30 Mar 2008 - 21:30:28 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive