On Dec 9, 2003, at 9:37 AM, Peter Dalgaard wrote:


Marc Schwartz <[EMAIL PROTECTED]> writes:

Confirmed on Fedora Core 1 with R Version 1.8.1 Patched (2003-12-07)
compiled using "gcc (GCC) 3.3.2 20031107 (Red Hat Linux 3.3.2-2)".


chisq.test(matrix(c(0, 1, 1, 12555), 2, 2), simulate.p.value=TRUE)
...
X-squared = 1e-04, df = NA, p-value = 1

chisq.test(matrix(c(0, 1, 1, 12556), 2, 2), simulate.p.value=TRUE)

X-squared = 1e-04, df = NA, p-value = < 2.2e-16 ...
chisq.test(matrix(c(0, 1, 1, 12557), 2, 2), simulate.p.value=TRUE)
...
X-squared = 1e-04, df = NA, p-value = 1

Ditto on RH8 with Martyn's RPM of 1.8.0 (yeah, I know...) and ditto with a reasonably current r-devel (gcc 3.2)

Anyways, it is yet another fudge-factor issue: If you debug to the
point in chisq.test where it calculates

PVAL <- sum(tmp$results >= STATISTIC)/B

you'll find that

Browse[1]> any(diff(tmp$result))
[1] FALSE
Browse[1]> tmp$result[1]
[1] 7.96432e-05
Browse[1]> STATISTIC
[1] 7.96432e-05
Browse[1]> tmp$result[1] - STATISTIC
[1] -1.355253e-20

so PVAL becomes zero and yaddayaddayadda....

The obvious fix would seem to be

PVAL <- sum(tmp$results >= (1-1e-10)*STATISTIC)/B

Yes, this is also the behavior that I am seeing. I do not know about numerical programming to comment on the fix, but it would solve the problem in my case.


Thanks to everyone who has looked into this!

Jeff

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to