James J. Roper <jjroper <at> 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") > > So, let´s say my subset vector is "Sex". How would I state the command > to get the test of that subset? > > Thanks in advance. > > Jim
The subset argument only applies to the formula method. It should be a boolean vector something like the following (assuming adults is a data frame): cor.test(~ Alt + Cab, adults, Sex=="MALE", alternative="greater", method="pearson") ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.