How Do Confidence Intervals Work?
How Do Confidence Intervals Work?
This Demonstration shows the confidence interval, ±m, for based on random samples of size from a normal population with mean and standard deviation , where is the sample mean and is the margin of error for a level interval. There are two cases, corresponding to when is assumed known, or is not known and is estimated by the standard deviation in the sample. For the known case, , where the critical value is determined so that the area to the right of is . Similarly in the unknown case, , where is the sample standard deviation and is the critical value determined from a -distribution with degrees of freedom.
x
μ
n
μ
σ
x
m
C
σ
σ
m=σ
*
z
n
*
z
*
z
(1-C)/2
σ
m=s
*
t
n
s
*
t
t
n-1
Five things to see in this Demonstration:
1. The width of the confidence interval increases as increases.
C
2. The width of the confidence interval decreases as increases.
n
3. For fixed and , the width of the confidence interval in the known case is fixed, but it is stochastic when is unknown due to the variation in the sample standard deviation, . The stochastic property can be seen by varying the random seed when unknown is selected.
C
n
σ
σ
σ
σ
4. The width of the confidence interval tends to be larger in the unknown case but the difference decreases as increases.
σ
n
5. Running an animation varying the random seed, we can obtain an empirical estimate of the coverage probability. Try slowing the animation down to get a large number of repetitions. The intervals are color coded: black when the interval covers and red when it misses. The animation demonstrates the stochastic coverage probability of the interval.
C
μ