Binomial confidence interval estimation - why is it not symmetric? I have used the following r code to estimate the confidence intervals of a binomial proportion because I understand that that substitutes for a "power calculation" when designing receiver operating characteristic curve designs looking at detection of diseases in a population.
n is 150, and the disease, we believe, is 25% prevalent in the population. I have calculated the values for 75% sensitivity and 90% specificity (because that's what people seem to do).
    binom.test(c(29,9), p=0.75, alternative=c("t"), conf.level=0.95)

    binom.test(c(100, 12), p=0.90, alternative=c("t"), conf.level=0.95)

I have also visited this site:
http://statpages.org/confint.html
Which is a java page which calculates binomial confidence intervals, and it gives the same answer.
Anyway, after that lengthy set-up, I want to ask why the confidence intervals are not symmetric, e.g. sensitivity is 
   95 percent confidence interval:
   0.5975876 0.8855583 

   sample estimate probability: 0.7631579 

Sorry if this is a basic question, but everywhere I look seems to suggest that they will be symmetric, and a colleague of mine seems to think they will be too.   
 A: @Joris mentioned the symmetric or "asymptotic" interval, that is most likely the one you are expecting.  @Joris also mentioned the "exact" Clopper-Pearson intervals and gave you a reference which looks very nice.  There is another confidence interval for proportions which you will likely encounter (note it is also not symmetric), the "Wilson" interval which is a type of asymptotic interval based on inverting the score test.  The endpoints of the interval solve  (in $p$) the equation
$$
(\hat{p} - p)/\sqrt{p(1-p)}=\pm z_{\alpha/2}
$$
Anyway, you can get all three in R with the following:
library(Hmisc)
binconf(29, 38, method = "asymptotic")
binconf(29, 38, method = "exact")
binconf(29, 38, method = "wilson")

Note that method "wilson" is the same confidence interval used by prop.test without Yates' continuity correction:
prop.test(29, 38, correct = FALSE)

See here for Laura Thompson's free SPLUS + R manual which accompanies Agresti's Categorical Data Analysis in which these issues are discussed in great detail.
A: Binomial distribution is just not symmetric, yet this fact emerges especially for $p$ near $0$ or $1$ and for small $n$; most people use it for $p\approx 0.5$ and so the confusion.
A: To see why it should not be symmetric, think of the situation where $p=0.9$ and you get 9 successes in 10 trials. Then $\hat{p}=0.9$ and the 95% CI for $p$ is [0.554, 0.997]. The upper limit cannot be greater than 1 obviously, so most of the uncertainty must fall to the left of $\hat{p}$.
A: They're believed to be symmetric because quite often a normal approximation is used. This one works well enough in case p lies around 0.5. binom.test on the other hand reports "exact" Clopper-Pearson intervals, which are based on the F distribution (see here for the exact formulas of both approaches).  If we would implement the Clopper-Pearson interval in R it would be something like (see note):
Clopper.Pearson <- function(x, n, conf.level){
    alpha <- (1 - conf.level) / 2
    QF.l <- qf(1 - alpha, 2*n - 2*x + 2, 2*x)
    QF.u <- qf(1 - alpha, 2*x + 2, 2*n - 2*x)

    ll <- if (x == 0){
          0
    } else { x / ( x + (n-x+1)*QF.l ) }

    uu <- if (x == 0){
          0
    } else { (x+1)*QF.u / ( n - x + (x+1)*QF.u ) }

    return(c(ll, uu))
}

You see both in the link and in the implementation that the formula for the upper and the lower limit are completely different. The only case of a symmetric confidence interval is when p=0.5. Using the formulas from the link and taking into account that in this case $n = 2\times x$ it's easy to derive yourself how it comes.
I personally understood it better looking at the confidence intervals based on a logistic approach. Binomial data is generally modeled using a logit link function, defined as:
$${\rm logit}(x) = \log\! \bigg( \frac{x}{1-x} \bigg)$$
This link function "maps" the error term in a logistic regression to a normal distribution. As a consequence, confidence intervals in the logistic framework are symmetric around the logit values, much like in the classic linear regression framework. The logit transformation is used exactly to allow for using the whole normality-based theory around the linear regression. 
After doing the inverse transformation:
$${\rm logit}^{-1}(x) = \frac{e^x}{1+e^{x}}$$
You get an asymmetric interval again. Now these confidence intervals are actually biased. Their coverage is not what you would expect, especially at the boundaries of the binomial distribution. Yet, as an illustration they show you why it is logic that a binomial distribution has asymmetric confidence intervals. 
An example in R:
logit <- function(x){ log(x/(1-x)) }
inv.logit <- function(x){ exp(x)/(1+exp(x)) }
x <- c(0.2, 0.5, 0.8)
lx <- logit(x)
upper <- lx + 2
lower <- lx - 2

logxtab <- cbind(lx, upper, lower)
logxtab # the confidence intervals are symmetric by construction
xtab <- inv.logit(logxtab)
xtab # back transformation gives asymmetric confidence intervals

note : In fact, R uses the beta distribution, but this is completely equivalent and computationally a bit more efficient. The implementation in R is thus different from what I show here, but it gives exactly the same result.
A: I know that it has been a while, but I thought that I would chime in here.  Given n and p, it is simple to compute the probability of a particular number of successes directly using the binomial distribution.  One can then examine the distribution to see that it is not symmetric.  It will approach symmetry for large np and large n(1-p).  
One can accumulate the probabilities in the tails to compute a particular CI.  Given the discrete nature of the distribution, finding a particular probability in a tail (e.g., 2.5% for a 95% CI) will require interpolation between the number of successes.  With this method, one can compute CIs directly without approximation (other than the required interpolation).  
A: There are symmetric confidence intervals for the Binomial distribution: asymmetry is not forced on us, despite all the reasons already mentioned.  The symmetric intervals are usually considered inferior in that


*

*Although they are numerically symmetric, they are not symmetric in probability: that is, their one-tailed coverages differ from each other.  This--a necessary consequence of the possible asymmetry of the Binomial distribution--is the crux of the matter.

*Often one endpoint has to be unrealistic (less than 0 or greater than 1), as @Rob Hyndman points out.
Having said that, I suspect that numerically symmetric CIs might have some good properties, such as tending to be shorter than the probabilistically symmetric ones in some circumstances.
