Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Binomial confidence intervals


From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   st: Re: Binomial confidence intervals
Date   Thu, 09 Sep 2004 13:56:07 +0900

Nick Cox wrote:

A small tweak to Joseph's useful program.
It feeds on a given sample size and
population proportion, but irrespective
of the latter 0.5 is wired in to a crucial
line. So I suggest

return scalar `method'_covered =
 (`pi' >= r(lb)) & (`pi' <= r(ub))

-inrange(`pi', r(lb), r(ub))- is a
another way of doing it.

----------------------------------------------------------------------------

Whoops--thanks Nick!

It started out fixed at 0.5 throughout; it originally was intended only as
an illustration where listers could see in the Stata code (invoking the
definition of the term, confidence interval) the difference between
probability of coverage, which was Bobby Gutierrez's point, and *exact* in
Constantine Daskalakis's sense.  For the purpose of the illustration, the
true proportion was arbitrarily fixed at 0.5 in the original code.  When
Paul Seed posted his question, the original purpose was abandoned, and I
tried--alas, too hastily--to generalize the program for another purpose:  a
further illustration of the versatility of simulation to answer questions in
the absence of alternative means.

Thanks also (and to Bobby) for making -bincoverage- available as one such
alternative means.  It is certainly preferable to simulation for practical
work.

Joseph Coveney




*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index