Wolfram Alpha:

```Confidence Intervals
--------------------

An interval estimate is defined by two numbers, between which
a population parameter is said to lie. For example, a < μ < b
is an interval estimate for the population mean, μ.

Confidence intervals are used to describe the amount of
uncertainty associated with a sample estimate of a population
parameter.

The confidence level describes how well the sample statistic
estimates the underlying population value.  Suppose we used the
same sampling method to select different samples and to compute
a different interval estimate for each sample.  Some interval
estimates would include the true population parameter and some
would not. A 90% confidence level means that we would expect
90% of the interval estimates to include the population
parameter.

The other way to say this is that if we drew repeated samples
90% of them would be sure to contain the population mean.  In
other words, although we don't know the population mean we're
90% sure it somewhere in the interval.

The CI does not mean there is a 90% chance that the population
parameter falls between a and b. This is incorrect.  The
population parameter is a constant not a random variable.  The
probability that it falls within a given range is either 0 or 1.

In the same way that statistical tests can be one or two-sided,
confidence intervals can be one or two-sided. A two-sided
confidence interval brackets the population parameter from
above and below.  A one-sided confidence interval brackets the
population parameter either from above or below and furnishes
an upper or lower bound to its magnitude.

Confidence Interval for the Population Mean
-------------------------------------------

Assume samples are drawn from a normal population.

CI = sample statistic +/- Margin of error

Notes:

-  The sample statistic is the midpoint of the CI.

-  The SAMPLING ERROR is the half the width of the CI

_  ^
x, p
+------------------+-------------------+
LCI                                    UCI
<------- SE ------><------- SE ------><

Confidence Interval for the Population Mean
-------------------------------------------

n ≥ 30:
_                  _
σ known:  x - Zα/2σ/√n < μ < x + Zα/2σ/√n
_
σ unknown:  x - Zα/2s/√n < μ < x + Zα/2s/√n

n ≤ 30:
_                     _
σ known:  x - tα/2,n-1σ/√n < μ < x + tα/2,n-1σ/√n
_                     _
σ unknown:  x - tα/2,n-1s/√n < μ < x + tα,n-1/2s/√n
_
In both cases s2 = Σ(xi - x)2/(n - 1)

Example: 95% CI Normal distribution
_
x +/- 1.96σ/√n

Confidence Interval for the Population Proportion
-------------------------------------------------

Again, assume samples are drawn from a normal population.
This means that np and n(1 - p> ≥ 10.

^                    ^
p - Zα/2√(pq/n) ≤ p ≤ p + Zα/2√(pq/n)  where q = (1 - p)

If n is not large enough the above procedure performs poorly
if p is small (i.e. np ≤ 10).  Under these circumstances
it is necessary to use Wilson's adjustment for p.  This is:

^
p = (x + 2)/(n + 4)

Where x is the number of 'successes' in the sample.  The CI
then becomes:

^                          ^
p - Zα/2√(pq/(n + 4)) ≤ p ≤ p + Zα/2√(pq/(n + 4))

Rule of Thumb for Calculating σ
-------------------------------

σ ~ range/4 = (UCL - LCL)/4

Confidence Interval for the Population Variance and SD
------------------------------------------------------

Again, assume samples are drawn from a normal population.

P(χ21-α/2 < (n - 1)s2/σ2 < χ2α/2) = 1 - α

P((n - 1)s2/χ2α/2 < σ2 < (n - 1)s2/χ21-α/2) = 1 - α

Therefore, the CI is:

((n - 1)s2/χ2α/2,(n - 1)s2/χ21-α/2)

and for the SD:

(√{(n- 1)s2/χ2α/2},√{(n- 1)s2/χ21-α/2})

Unlike the Student-t and Normal distribution, the χ2 distribution
is asymmetric so the left and right tails are different.

Confidence Interval for the Ratio of the Population Variances
-------------------------------------------------------------

Again, assume samples are independent and drawn from a
normal population.

P(F1-α/2 ≤ (s12/σ12)/(s22/σ22) ≤ Fα/2) = 1 - α