Re: [R] exact 95% confidence intervals

From: Frank E Harrell Jr <f.harrell_at_vanderbilt.edu>
Date: Wed 27 Sep 2006 - 17:16:31 GMT

Peter Dalgaard wrote:
> Frank E Harrell Jr <f.harrell@vanderbilt.edu> writes:
>

>> Peter Dalgaard wrote:
>>> "XinMeng" <xmeng@capitalbio.com> writes:
>>>
>>>> Hello sir:
>>>> As to the 2*2 table format for reporting results comparing a new
>>>> test to true diagnosis,when I got the sensitivity and
>>>> specificity,how can I calculate the exact 95% confidence intervals
>>>> (based on the binomial distribution) for sensitivity and specificity
>>>> via R?
>>> Just run binom.test on the data from each column (or row, depending
>>> on
>>> which way you turn the tables).
>>>
>> But beware of exact binomial intervals - they are often not very
>> accurate.  Wilson and other intervals are generally better.  For
>> example see the binconf function in the Hmisc package.

>
> I suppose that by "accurate" you mean that they are generally better
> at getting the coverage rate right?

Yes

>
> The "exact" intervals are strictly conservative, but at least
> predictably so. The whole thing is largely a matter of taste to my
> mind, but I know that other people (notably Alan Agresti) have
> stronger opinions.

I tend to side with Agresti, and emphasize the expected absolute error in confidence coverage.

>
> (People taking an interest in this may want to have a look at
> http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval )

nice to know!

Frank



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 Thu Sep 28 03:26:43 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 Wed 27 Sep 2006 - 18:30:06 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.