Hello everybody. Does anyone else find the last test in the following sequence odd? Can anyone else reproduce it or is it just me?> binom.test(100,200,0.13)$p.value[1] 2.357325e-36> binom.test(100,200,0.013)$p.value[1] 6.146546e-131> binom.test(100,200,0.0013)$p.value[1] 1.973702e-230> binom.test(100,200,0.00013)$p.value[1] 0.9743334 (R 1.5.1, Linux RedHat 7.1) -- Robin Hankin, Lecturer, School of Geography and Environmental Science Tamaki Campus Private Bag 92019 Auckland New Zealand r.hankin at auckland.ac.nz tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042 as of: Mon Sep 23 11:01:00 NZST 2002 This (linux) system up continuously for: 389 days, 17 hours, 43 minutes -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 23 Sep 2002, Robin Hankin wrote:> Hello everybody. > > Does anyone else find the last test in the following sequence odd? > Can anyone else reproduce it or is it just me? > > > > binom.test(100,200,0.13)$p.value > [1] 2.357325e-36 > > binom.test(100,200,0.013)$p.value > [1] 6.146546e-131 > > binom.test(100,200,0.0013)$p.value > [1] 1.973702e-230 > > binom.test(100,200,0.00013)$p.value > [1] 0.9743334 >Yes. The p-value is evaluated by adding up binomial probabilities, but it leads to catastrophic rounding error. One solution would be to use the incomplete beta function (pbeta) either always or in extreme cases. That's how the confidence limits are computed and they don't break down in this case. So eg> pbeta(0.13,100,101)[1] 2.357325e-36> pbeta(0.013, 100, 101)[1] 6.146546e-131> pbeta(0.0013,100,101)[1] 1.973702e-230> pbeta(0.00013, 100, 101)[1] 0 which agrees on the first three and is a lot closer on the last. -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 23 Sep 2002, Robin Hankin wrote:> Hello everybody. > > Does anyone else find the last test in the following sequence odd? > Can anyone else reproduce it or is it just me? >Actually the previous explanation is completely bogus (I plead jet lag). The problem is in handling 2-tailed p-values, which is done by looking for the value in the opposite tail where the density is <= (1+1e-7) times the observed density. The problem is that the observed density is 0. It should be possible just to change <= to <, possibly increasing the fudge factor from 1e-7 but perhaps not. -thomas -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
The same happened to me. So far I found that the approximated breaking point for the p-value is the following number (given that x = 100 and n = 200): 0.000136737615520986 That is doing, binom.test(x=100,n=200,p) with p less than the above number, gives an incorrect p-value. (I am using Windows Me) Daniel At 11:05 AM 23/9/2002 +1200, Robin Hankin wrote:>Hello everybody. > >Does anyone else find the last test in the following sequence odd? >Can anyone else reproduce it or is it just me? > > > > binom.test(100,200,0.13)$p.value >[1] 2.357325e-36 > > binom.test(100,200,0.013)$p.value >[1] 6.146546e-131 > > binom.test(100,200,0.0013)$p.value >[1] 1.973702e-230 > > binom.test(100,200,0.00013)$p.value >[1] 0.9743334 > >(R 1.5.1, Linux RedHat 7.1) > > >-- > >Robin Hankin, Lecturer, >School of Geography and Environmental Science >Tamaki Campus >Private Bag 92019 Auckland >New Zealand > >r.hankin at auckland.ac.nz >tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._