Re: [R] spearman rank correlation problem

2004-03-16 Thread Martin Maechler
William == William T Morgan [EMAIL PROTECTED] on 15 Mar 2004 16:37:08 -0500 writes: William Hello R gurus, William I want to calculate the Spearman rho between two ranked lists. I am William getting results with cor.test that differ in comparison to my own William spearman

Re: [R] spearman rank correlation problem

2004-03-16 Thread Robert W. Baer, Ph.D.
Martin Maechler writes: It seems that this needs to be documented, since you are right, the1 - 6 S(d^2) / (n^3 - n)( d = r1 - r2 ; r{12} := rank(x{12}) ) formula is also in use as *definition* for Spearman's rank correlation. Since this topic is here... Although I seen the above

[R] spearman rank correlation problem

2004-03-15 Thread William T Morgan
Hello R gurus, I want to calculate the Spearman rho between two ranked lists. I am getting results with cor.test that differ in comparison to my own spearman function: my.spearman function(l1, l2) { if(length(l1) != length(l2)) stop(lists must have same length) r1 - rank(l1) r2