MATLAB: Confidence interval for single proportion with exact method

statistics

I am trying to compute confidence interval for single proportion using exact method based on binomial distribution with matlab. For example, if you look at chapter 510 on the NCSS user manual it describes (<http://www.ncss.com/pdf/manuals/NCSSUG5.pdf>) what I am trying calculate. I would think that the statistics toolbox would have this capability, but I can't seem to locate it. Please let me know if you this function, or how I might be able to replicate it with Matlab and the stats toolbox. Thanks.

Best Answer

Sounds like you want the binofit() function. It uses the Clopper-Pearson method to calculate the confidence intervals. This Wikipedia page has info on the method, and the extent to which it is "exact": http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval.