Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: prtest confidence interval

From   Steve Samuels <>
Subject   Re: st: prtest confidence interval
Date   Sat, 10 Nov 2012 23:08:45 -0500

The Manual entry for -prtest- shows the formula that it uses the normal
approximation. This approximation doesn't "know" that the binomial CIs
should be in [0,1]. Also the confidence intervals based on the
approximation are bad unless "n" is large, especially for high and low
values of the unknown probability (Brown et al., 2001). So the answer to
your first question is "No" and the answer to your second is "Yes".

For CIs, the "exact" confidence intevals (Clopper-Pearson) are very
conservative. (Agresti & Coul, 1998). I recommend -ci- with the
-binomial- and -agresti- option. Also, if you are interested in a test
p-value, run -bitest- with the -detail- option and construct your own
mid-p-value (Agresti, 2002, p. 20) using the returned results


Agresti, A., and B.A. Coull. 1998. Approximate is better than “exact”
for interval estimation of binomial proportions. The American
Statistician 52, no. 2: 119-126.

Agresti, A. 2002. Categorical data analysis. Hoboken, NJ:

Brown, L.D., T.T. Cai, and A. DasGupta. 2001. Interval estimation for a binomial proportion. Statistical Science 101-117.
available at:


On Nov 10, 2012, at 4:17 PM, Kenneth A Knapp wrote:

For a binary variable, to get a confidence interval I include the "binomial" option:
ci variable, binomial
(variable is  the name of a binary variable)

Trouble is, when I exectute:
prtest variable==X
(X is a number between 0 and 1)
the reported confidence interval doesn't match the interval obtained from "ci variable, binomial"
Rather, the reported confidence interval is the same as I get when I execute "ci viariable" -- that is, the ci command without the "binomial" option.

A particular binary variable I am working with has an upper bound confidence interval > 1 when I execute "ci" without the binomial option.

Any way to correct prtest so that the confidence intervals reported match those you get when you execute ci with the binomial option?
Is such a correction even needed?  

Any help would be very much appreciated.
Ken K
Seton Hall
*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index