Dear all,
Why can't calculate 46341*46341 using '*'? I must have missed something
very basic...
> 46340.99999*46340.99999
[1] 2147488280
> 46341*46341
[1] NA
> 4.6341E4
[1] 46341
> 4.6341E4*4.6341E4
[1] 2147488281
> 46341^2
[1] 2147488281
My function of for unbiased skew (Sokal & Rohlf 3ed p 115) involves a
multiplication, and when my samples are 'big' the answer is just 'NA'
due to the problem described above:
skew.sokal <- function(x){
m3 <- length(x) * sum((x-mean(x))^3)/((length(x)-1)*(length(x)-2))
s3 <- sqrt(var(x))^3
m3/s3}
> x <- rnorm(46342)
> skew.sokal(x)
[1] 0.0101318
> x <- rnorm(46342)
> skew.sokal(x)
[1] -0.00613662
> x <- rnorm(46343)
> skew.sokal(x)
[1] NA
Thanks in advance for any suggestion! And sorry if I have overseen
something basic...
S-plus 6.2 Build 6713
WinXP
--
************************
Henrik Pärn
Department of Biology
NTNU
7491 Trondheim
Norway
+47 735 96282 (office)
+47 909 89 255 (mobile)
+47 735 96100 (fax)
************************
|