Confidence Intervals for Variance of Normal
On the previous board we discussed confidence intervals for estimating the mean of a normal random variable. We considered settings where the variance was known ("
We previously computed that
But what about standard error
I think that the standard error is
To make confidence intervals for
"Chi-squared with
Converting to
1 hidden cell
Shape of the (Chi-Squared) Distribution
The
-
, the number of degrees of freedom , twice the number of degrees of freedom
As
(Once degrees of freedom is around
Example:
The graphs below show the
Solving
for the variance yields
Note:
Substituting in quantile values
•
•
results in a
Note: The square root function is 1-1 and increasing, so taking square roots of the expression above yields
Example:
The code below computes
For the
Bootstrap Confidence
The graphs above look pretty reasonable. Since this is a
Confidence Intervals for Population Proportion
Population proportion is a common application for confidence intervals and hypothesis testing. This is the situation which arises when you want to approximate the proportion of a large population with some property. Instead of testing every individual in the population, you instead sample a subset and test them. The observed sample proportion
If the total population is sufficiently large compared to the sample size, then the observed sample
We would like to make a confidence interval for
1 hidden cell
The Wald CI for Population Proportion
The earliest and simplest way to make a confidence interval around
So for big
Hardening our hearts against all doubts and fears, we can blindly combine all of these approximations to construct a "confidence interval" around
where is the normal quantile
Note: The Wald confidence interval is really, really bad. Since it doesn't account for the standard error of
Example:
In the example below, we'll make
Bootstrap confidence (Comparing different methods)
Over the years, many different methods have been developed for computing confidence intervals for population proportion. The most well-known methods are the following
- The classical "Wald" interval, from approximating binomial by normal and using
for gives intervals which are too small -- so the computed " CI" may actually capture the true value only of the time. This is especially pronounced for small and big values. - In 1927, the Wilson "score" interval was proposed. Instead of using
for , as the Wald interval does, Wilson suggested solving the equation
for . [Our textbook confuses this with the later Agresti-Coull interval.] The score interval is pretty good, and is the interval method used by R's prop.test(..) function. Unfortunately the resulting interval bounds are rather intimidating.
- In 1934, the Clopper—Pearson "exact" interval was proposed using the beta distribution (from inverting binomial tests). The goal of Clopper-Pearson was to ensure that the "
CI" captured the correct value at least of the time. [Clopper-Pearson is designed to be too big.] This is the interval method used by R's binom.test(..) function. It also results in intimidating formulas... - In 1998, Agresti and Coull proposed a "corrected Wald" interval. Agresti and Coull did a detailed bootstrap analysis of different confidence interval methods and concluded that people should use the score interval. But then they note that, if you really want to use Wald, then there is a simple way to "correct" it for
CI: It is enough to do Wald intervals with modified data and (add two "successes" and two "failures" to data).
For an excellent discussion of different intervals and their bootstrap confidence levels, I suggest looking at the 1998 paper of Agresti-Coull [https://math.unm.edu/~james/Agresti1998.pdf] which is quite readable even for non-statisticians.
Let's compare a few different methods!
- The Wald interval. Approximate by normal, using
for . This should give intervals which are too small; since we aren't accounting for the standard error of .. but if isn't too big or too small, and is large, then maybe if we pray hard enough things won't be too bad. - The Wilson score interval. (See the crazy formula above or in the textbook.) This is the standardly accepted "best choice".
- Maximum likelihood estimated interval. I just made this one up because I was bored and wanted to try my hand at this problem.
Instead of doing clever theory, I take advantage of the computer to brute-force a search for maximum likelihood values where
In theory this should give good estimates... at the price of being VERY SLOW.
Note: For symmetric distributions (like normal or t) the MLE bounds are equivalent to the usual confidence interval bounds. But this is not true for the binomial distribution!
I'm a little bit sad that my "MLE interval" appears to be too big when n gets large. I guess its not too bad for something I made up. Possibly I'm not handling the endpoints of my interval correctly, and this could be fixed with a bit more thought....
Let's also do a comparison with "adjusted Wald".