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

From: Joris Meys <jorismeys_at_gmail.com>
Date: Tue, 08 Jun 2010 22:49:46 +0200

result <- cor.test(a,b,method="spearman") result$estimate

Cheers
Joris

On Tue, Jun 8, 2010 at 10:40 PM, Ekaterina Pek <ekaterina.pek_at_gmail.com> wrote:
> 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()
>
> -- in order to save then the value in some format into external file.
>
> 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.
>

-- 
Joris Meys
Statistical consultant

Ghent University
Faculty of Bioscience Engineering
Department of Applied mathematics, biometrics and process control

tel : +32 9 264 59 87
Joris.Meys_at_Ugent.be
-------------------------------
Disclaimer : http://helpdesk.ugent.be/e-maildisclaimer.php

______________________________________________
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:52:07 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