[R] small bug in binom.test?

Jerome Goudet Jerome.Goudet at ie-zea.unil.ch
Wed Jan 22 09:17:02 CET 2003


Hi all,

I am wondering whether there is a small bug in the binom.test function of 
the ctest library (I'm using R 1.6.0 on windows 2000, but Splus 2000 seems 
to have the same behaviour). Or perhaps I've misunderstood something.

the command binom.test(11,100,p=0.1) and binom.test(9,100,p=0.1) give 
different p-values (see below).  As 9 and 11 are equidistant from 10, the 
mean of the distribution, I would have thought that the probabilities 
should be the same. For instance, binom.test(49,50,0.5) and 
binom.test(51,100,0.5) do give the same results. Any help wouldbe 
appreciated. Jerome



 > binom.test(11,100,0.1)

         Exact binomial test

data:  11 and 100
number of successes = 11, number of trials = 100, p-value = 0.7377
alternative hypothesis: true probability of success is not equal to 0.1
95 percent confidence interval:
  0.05620702 0.18830113
sample estimates:
probability of success
                   0.11

 > binom.test(9,100,0.1)

         Exact binomial test

data:  9 and 100
number of successes = 9, number of trials = 100, p-value = 0.8681
alternative hypothesis: true probability of success is not equal to 0.1
95 percent confidence interval:
  0.04198360 0.16398226
sample estimates:
probability of success
                   0.09


Jerome GOUDET
Institut d'Ecologie, Bat. Biologie
Uni. Lausanne , CH-1015 Lausanne
Switzerland
Tel: +41 21 692 42 42    Fax: +41 21 692 42 65
Secr:+41 21 692 42 60




More information about the R-help mailing list