[R] binom.test and small N

Tony Long tdlong at uci.edu
Fri Mar 22 18:58:41 CET 2002


running R 1.4.1 on MAC and 1.2.2 on Linux

When I use run binom.test with small N the results are a little 
perplexing to me

>binom.test(9,20,p=0.5)

gives the below plus other stuff

95 percent confidence interval:
  0.2305779 0.6847219

Now:

>pbiom(9,20,0.6847219)
[1] 0.02499998    # i.e., lower 2.5% of distribution
>pbinom(9,20,0.2305779)
[1] 0.9923132
>pbinom(8,20,0.2305779)
  [1] 0.975     # i.e.,  upper 2.5% of distribution

I would think I generally want a 95% CI on the observed 9 out of 20, 
not 8 out of 20 LB and 9 out of 20 UB.  I am missing something or is 
this strictly a function of the beta approximation used in the source 
code??

-- 

Tony Long

Ecology and Evolutionary Biology
Steinhaus Hall
University of California at Irvine
Irvine, CA
92697-2525

Tel:  (949) 824-2562   (office)
Tel:  (949) 824-5994   (lab)
Fax: (949) 824-2181

email:  tdlong at uci.edu
http://hjmuller.bio.uci.edu/~labhome/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20020322/497ea0c2/attachment.html


More information about the R-help mailing list