[R] cor.test() -- how to get the value of a coefficient

From: Ekaterina Pek <ekaterina.pek_at_gmail.com>
Date: Tue, 08 Jun 2010 22:40:53 +0200


Hi, all.

Yet another beginner to R : )

I wonder, how it's possible to get the value of a coefficient from the object produced by cor.test() ?

> cor.test(a, b, method="spearman")

        Spearman's rank correlation rho

data: a and b
S = 21554.28, p-value = 2.496e-11
alternative hypothesis: true rho is not equal to 0 sample estimates:

      rho
0.6807955

Warning message:
In cor.test.default(a, b, method = "spearman") :   Cannot compute exact p-values with ties

So, I'd like to do something like :

> result = cor.test(...)
> rho = result.rho()

Thanks in advance for helping !

Regards,
Kate.



R-help_at_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. Received on Tue 08 Jun 2010 - 20:43:20 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 Tue 08 Jun 2010 - 21:20:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive