Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: Re: Simplification of mata syntax to determine CI possible?

From   Dirk Enzmann <>
Subject   st: Re: Simplification of mata syntax to determine CI possible?
Date   Wed, 06 Jul 2011 15:31:08 +0200

In reply to Nick ( ):


pp = range(0.000001,0.999999,1/99999)

is a dodgy thing the do but this it not essential - I did it to compare the results experimentally to another routine where I used a vector of 100,000 rows. Of course, you could work with 100,001 rows and use

 pp = range(0,1,.00001)

, instead.

And yes, I read the Brown et al. (2001) paper. As to the likelihood ratio interval they write (p. 114): "Brown, Cai and DasGupta (1999) show by analytical calculations that this interval has nice properties. However, it is slightly harder to compute." (unfortunately their reference to Brown et al., 1999, is lacking).

Because -ci- lacks this type of interval, I tried it on my own. Ultimately, I would like to be able to replicate the examples given by Brown et al. (2001) using Stata instead of the R (see:


). However, as I said, I would like to know whether it is possible to replace the 13 lines of mata by something more efficiently as the one line I used in the R function. Or if there is an even better approach to construct the likelihood ratio confidence interval using Stata.

Brown, L.D., Cai, T.T., & DasGupta, A. (2001). Interval estimation for a binomial proportion. Statistical Science, 16(2), 101-133.

Dirk Enzmann
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index