Dear Frank and Felipe,
Thank you both for your replies. The code looks exactly like the
formula in Japanese wikipedia which I was trying to make sense of (as it
wasn't in English wikipedia). Thank you for sharing your code with, Felipe!
And the clarification, Frank. Knowing many ways of
] 0.2319084
rs(y[,1],y[,2])
[1] 0.2319084
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Raymond Wan
Sent: Monday, May 28, 2007 10:29 PM
To: r-help@stat.math.ethz.ch
Subject: [R] R's Spearman
Hi all,
I am trying to figure out the formula used by R's
[,2],method=spearman)
[1] 0.2319084
rs(y[,1],y[,2])
[1] 0.2319084
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Raymond Wan
Sent: Monday, May 28, 2007 10:29 PM
To: r-help@stat.math.ethz.ch
Subject: [R] R's Spearman
Hi all,
I am trying
Hi all,
I am trying to figure out the formula used by R's Spearman rho (using
cor(method=spearman)) because I can't seem to get the same value as by
calculating by hand. Perhaps I'm using cor wrong, but I don't know
where. Basically, I am running these commands:
Hi,
You can try with
cor.test(rank(y[1]),rank(y[2]))
On 5/29/07, Raymond Wan [EMAIL PROTECTED] wrote:
Hi all,
I am trying to figure out the formula used by R's Spearman rho (using
cor(method=spearman)) because I can't seem to get the same value as by
calculating by hand. Perhaps I'm
Hi,
Chung-hong Chan wrote:
Hi,
You can try with
cor.test(rank(y[1]),rank(y[2]))
Thanks for this! It didn't solve my problem, but it helped me realize
that the formula I was using by hand is invalid for the tie case. I
just realized that with R's cor function, the Pearson correlation