Displaying 2 results from an estimated 2 matches for "dhoysak".
Did you mean:
hoysak
2004 Nov 11
5
wrong answer for simple expressions
I am experiencing strange (to me) output when trying to do simple
calculations. Expressions that should equal zero yield non-zero
values.
Examples:
> a <- 4.1-3.1
> b <- 5.1-4.1
> a-b
[1] -4.440892e-16
> (4.1-3.1)-(5.1-4.1)
[1] -4.440892e-16
When this last expression is expanded, I get the right answer:
> 4.1-3.1-5.1+4.1
[1] 0
I am using the binary packaged version
2004 May 20
1
Spearman probabilities and SuppDists
cor.test and SuppDists give me different P-values for the same
Spearman's rho. Which is correct, or am I doing something wrong?
> x <- c(44.4, 45.9, 41.9, 53.3, 44.7, 44.1, 50.7, 45.2, 60.1)
> y <- c( 2.6, 3.1, 2.5, 5.0, 3.6, 4.0, 5.2, 2.8, 3.8)
> cor.test(x,y,method="spearman")
Spearman's rank correlation rho
data: x and y
S = 48, p-value =