Re: [R] binom.test

From: Chuck Cleland <ccleland_at_optonline.net>
Date: Thu 19 Oct 2006 - 15:27:35 GMT

Ethan Johnsons wrote:
> R-experts:
>
> A quick question, please.
>

>>From a lab exp, I got 12 positives out of 50.

> To get 90% CI for this , I think binom.test might be the one to be used.
> Is there a better way or function to calculate this?
>
>> binom.test(x=12, n=50, p=12/50, conf.level = 0.90)

>
> Exact binomial test
>
> data: 12 and 50
> number of successes = 12, number of trials = 50, p-value = 1
> alternative hypothesis: true probability of success is not equal to 0.24
> 90 percent confidence interval:
> 0.1447182 0.3596557
> sample estimates:
> probability of success
> 0.24

You might consider binconf() in the Hmisc package too:

library(Hmisc)
binconf(12, 50, method="all")

           PointEst    Lower    Upper
Exact          0.24 0.130610 0.381691
Wilson         0.24 0.142974 0.374127
Asymptotic     0.24 0.121621 0.358379

> thx much
>
> ej
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri Oct 20 11:20:27 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 20 Oct 2006 - 06:30:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.