Re: [R] Using "subset" in correlation analysis

2008-03-19 Thread David Barron
You have to use the formula interface, so something like this: cor.test(~ Alt + Cab, data=adults, alternative="greater", subset=Sex=="male") David On Wed, Mar 19, 2008 at 12:59 PM, James J. Roper <[EMAIL PROTECTED]> wrote: > The correlation test function says that it can do a subset where one >

Re: [R] Using "subset" in correlation analysis

2008-03-19 Thread Mark Lyman
James J. Roper gmail.com> writes: > > The correlation test function says that it can do a subset where one > specifies the subsete vector. I cannot seem to get it to work. > > For example, the command line is: > > cor.test(adults$Alt, adults$Cab, alternative="greater", method="pearson") > >

[R] Using "subset" in correlation analysis

2008-03-19 Thread James J. Roper
The correlation test function says that it can do a subset where one specifies the subsete vector. I cannot seem to get it to work. For example, the command line is: cor.test(adults$Alt, adults$Cab, alternative="greater", method="pearson") So, let´s say my subset vector is "Sex". How would I