[R] p-value in Spearman rank order

Daniel Malter daniel at umd.edu
Fri Feb 29 06:31:51 CET 2008


Has your question been answered yet?

x=c(1,2,4,3,6,8)
y=c(3,2,5,7,4,6)

cor.test(x,y,method="spearman")

####And that's how you "extract" the p-value:

cor.test(x,y,method="s")$p.value

Cheers,
Daniel


--------------------------
Abstrakthelfer helfen wenig
--------------------------

-----Ursprüngliche Nachricht-----
Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im
Auftrag von Anne-Katrin Link
Gesendet: Thursday, February 28, 2008 10:17 AM
An: r-help at r-project.org
Betreff: [R] p-value in Spearman rank order

Dear R-helpers,

I would like to do a Spearman rank order test, and used the cor() function
with the method "spearman". 
It gives me a number (correlation coefficient?) , but how can I get the
p-value?
Thank you for the help in advance!

Regards,
Anne-Katrin
    
-- 



	[[alternative HTML version deleted]]

______________________________________________
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.



More information about the R-help mailing list