In the practice of basket ball, Jonny did 40 shots to a basketball hole, 26 of them, he succeeded to put the ball. So that, 95% interval confidency for true proportion of Jonny's ball shot who was done in long-range is.....
Several papers argue against the method described above. There is a package, http://cran.r-project.org/web/packages/PropCIs/PropCIs.pdf, that calculates some of the different measures for the CI for a proportion. If the following is input in R
install.packages("PropCIs")
library(PropCIs)
x blakerci(x,n,conf.level=.95)
data:
95 percent confidence interval:
0.4872055 0.7880575
> exactci(x,n,conf.level=.95)
data:
95 percent confidence interval:
0.4831555 0.7937175
> midPci(x,n,conf.level=.95)
data:
95 percent confidence interval:
0.4941 0.7846
> scoreci(x,n,conf.level=.95)
data:
95 percent confidence interval:
0.4951 0.7787
>
see Agresti (2013) (http://www.stat.ufl.edu/~aa/cda/cda.html) for discussion generally on categorical variables and the references in the package manual for PropCIs cited above for details of these tests..
Elmer is correct that in some situations it is fine to use methods even if there are better methods. His example of using a z test when others would use a t test is a good example. With small samples the CI won't be as large as it should, but in many situations this precision won't matter.
For proportions, his point that the confidence intervals are the same (or close enough for most purposes) tends to be true if the p is near .5. Suppose Larry Bird was shooting and hit 39 of 40 (or I was shooting and hit 1 of 40). Here is the Wald method and I'll just print the first of the methods.