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.
It is true that sometimes - with a large sample size and a proportion near the middle of the range - the simple interval Mohammad suggests would be as good as anything. HOWEVER - it has huge deficiencies when these conditions are not satisfied. As noted above, there are numerous better methods available. Not to worry - I have made available on the web a very simple, effective method that is implemented in a genuinely highly user-friendly Excel spreadsheet. When you open the file, the calculation is displayed for an exemplar dataset. Simply replace the displayed figures by those for your own data, and the CI for your data appears instead of that for the exemplar data. The first block of the spreadsheet CIPROPORTION.xls is for a simple proportion. The second and third blocks are for unpaired and paired differences of proportions. This spreadsheet is attached, also it and other related spreadsheets are freely downloadable from