An α% confidence interval for an unknown population parameter θ, say, is an interval, calculated from sample values by a procedure such that if a large number of independent samples is taken, α% of the intervals obtained will contain θ. The term ‘confidence interval’ was introduced in 1934 by Neyman.
A confidence interval can also be thought of as a single observation of a random interval, calculated from a random sample by a given procedure, such that the probability that the interval contains θ is α%. For example, if X1, X2,…, Xn is a random sample from a normal distribution with unknown mean μ and known variance σ2, and writing X̄=(X1+X2+…+Xn)/n,soHence, if x̄ is the observed value of the sample mean, the end points of the corresponding 95% confidence interval for the mean, μ, are x̄±1.96σ/. This is a symmetric confidence interval. It is possible to have a one-sided confidence interval. For example μ>x̄ −1.645σ/ is a one-sided 95% confidence interval for the mean, μ.
If the population variance is not known then, to find a confidence interval for the mean, the t-distribution can be used and the end points of the 95% confidence interval for the mean are where tn−1(0.025) is the critical value corresponding to an upper-tail probability of 2.5% for a t-distribution with (n−1) degrees of freedom, and s is the unbiased estimate of the population variance based on the sample values.
In the case when the population is not known to be normal the central limit theorem may be used, provided n is reasonably large, to give the values x̄ ± 1.96 s/ as an approximate symmetric 95% confidence interval for μ.
Finding a confidence interval for a population proportion is difficult, owing to the discrete nature of the binomial distribution, unless the sample size n is large enough for the normal approximation to the binomial distribution to be valid. In this case the ends of the α% symmetric confidence interval for the population proportion are the values p such thatwhere p̂ is the sample proportion and K is the critical value corresponding to an upper-tail probability of ½(100−α)% for a standard normal distribution. See also Clopper-Pearson methods.
Equivalently, the α% confidence limits are the roots of the quadratic equationAn often used, but not recommended, approximate formula isSince p̂(1−p̂) ≈ ¼ for values of p̂ not too close to 0 or 1, an even simpler form isHence for a sample of size 1 000 the 90% confidence limits are approximated by p=p̂±0.03, which is possibly the source of the oft-repeated statement that estimates of percentages from an opinion poll have a possible error of ±3%.
A confidence interval for a population variance σ2 can be found, under the assumption that the population is normal. If s2 is the unbiased estimate of the population variance, based on a sample of size n, then the α% confidence for σ2 is given bywhere L is the critical value corresponding to a lower-tail probability of ½(100−α)%, for a chi-squared distribution with (n−1) degrees of freedom, and U is the critical value corresponding to an upper-tail probability of the same size (see appendix VIII).
http://onlinestatbook.com/stat_sim/conf_interval/index.html Applet.