Skip to content
Prev 147614 / 398500 Next

how to extract object from stats test output (cor.test)?

On 6/19/2008 11:01 AM, Patrick Ayscue wrote:
See the Value section of the ?cor.test man page.  It says that the 
result is a list containing (among other things) the components

statistic: the value of the test statistic.

estimate: the estimated measure of association, with name '"cor"',
           '"tau"', or '"rho"' corresponding to the method employed.

I think "estimate" is what you want, which you can get as

cor.test (datavector1, datavector2[i], method=("spearman"))$estimate

This is a numeric vector with one element named "rho", in the example on 
the ?cor.test page.

Duncan Murdoch