cor.test versus rcorr

548 views
Skip to first unread message

Cathleen

unread,
Feb 20, 2013, 6:39:58 AM2/20/13
to corplin...@googlegroups.com
I haven't been able to find an answer to this question in any of my reference books: I want to look at multiple correlations, all one-tailed Pearson, excluding missing data pair-wise. I think I have to do a series of tests using the 'cor.test' function? Or is there a way to do them all in one go with the 'rcorr' function? Thanks in advance...
 

Stefan Th. Gries

unread,
Feb 20, 2013, 11:40:43 AM2/20/13
to corplin...@googlegroups.com
Well, since you already mention Hmisc::rcorr, have you tried it before
posting? Because it works here ...

library(Hmisc)
x <- round(matrix(rnorm(1000), ncol=10), 3)
rcorr(x)

The p-values are two-tailed, though:

cor.test(x[,1], x[,2])

STG
--
Stefan Th. Gries
-----------------------------------------------
University of California, Santa Barbara
http://www.linguistics.ucsb.edu/faculty/stgries
-----------------------------------------------
> --
> You received this message because you are subscribed to the Google Groups
> "CorpLing with R" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to corpling-with...@googlegroups.com.
> To post to this group, send email to corplin...@googlegroups.com.
> Visit this group at http://groups.google.com/group/corpling-with-r?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages