I was (pleasantly) surprised by the number of "hits" my recent post on "Minimizing the Length of a Confidence Interval" attracted. As has often been the case, a lot of visitors came by way of Mark Thoma's excellent blog, Economist's View. (Thanks, Mark!)
In that post one of the things I discussed was the issue of constructing a "shortest length" confidence interval in the case where the distribution of the pivotal statistic that's used to start off the interval is asymmetric. In such cases, we have a more difficult task on our hands than when the distribution is symmetric, and uni-modal. In response to this, we usually construct "equal tails" confidence intervals in the asymmetric case.
I'm not going to repeat the previous post! Instead, I'm going to share a few lines of R code that I've put together to deal with this issue in the case of an asymmetric distribution that's of great practical importance to econometricians.