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.
References:
Brown, L.D., Cai, T.T., & DasGupta, A. (2001). Interval estimation for a
binomial proportion. Statistical Science, 16(2), 101-133.