[R] binom.test bug?

Thomas Lumley thomas at biostat.washington.edu
Mon Oct 2 17:27:05 CEST 2000


On Mon, 2 Oct 2000, Derek N Eder wrote:

> R. 1.1.0
> 
> The example below is self explanatory.

So is the error message :)
 
> 
> ##  1  ##                                                      # works fine
>  > binom.test((50*.64),50,.5,alt='g')
> ...     Exact binomial test  ...

50*0.64=32, an integer between 0 and 50

> ##  2  ##                               #  WHAT  ! ?
>  > binom.test((50*.65),50,.5,alt='g')
> 
> Error in binom.test((50 * 0.65), 50, 0.5, alt = "g") :
>          x must be an integer between 0 and n

50*0.65=32.5, not an integer between 0 and 50. You can't get 65% successes
in 50 Bernoulli trials.


> ##  3  ##                               # works fine
>  > binom.test((50*.66),50,.5,alt='g')
> ...      Exact binomial test  ...

50*0.66=33, an integer between 0 and 50


	-thomas

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list