next up previous
Next: About this document Up: No Title Previous: No Title

An Example of Asymptotics: Confidence Intervals for a Binomial p Based on Normal Approximation.

Here, we compute the actual coverage probability of the ``usual'' confidence interval for the success probability p in a Binomial Experiment. This interval is based on the normal approximation. Suppose tex2html_wrap_inline217 where tex2html_wrap_inline219 is unknown. If n is large (and p is not too close to 0 or 1), then the point estimate tex2html_wrap_inline229 = Y/n has approximately a normal distribution. More precisely, tex2html_wrap_inline235 is approximately N(0,1), or we say

  equation142

Thus,

displaymath211

One can also show that

  equation148

This will follow from Slutsky's theorem, and will be shown later in the course. Now with a little algebra on the inequalities defining the event we have

  equation154

Thus,

  equation163

gives an approximate tex2html_wrap_inline239 confidence interval for p if n is large (and p is not too close to 0 or 1).

So the nominal coverage probability is tex2html_wrap_inline239 , but what is the actual coverage probability? To investigate this, we wrote an Splus function to determine first what the confidence interval is for given values of n, y (the realization of Y), and the nominal coverage probability:

> Na0int
function(n, y, nominal)
{
# computes approx. confidence interval for binomial p
#   based on simple normal approx. with given "nominal" cov. prob.
#
        alpha <- 1 - nominal
        zalpha <- qnorm(1 - alpha/2)
        phat <- y/n
        se <- sqrt((phat * (1 - phat))/n)
        halfwidth <- zalpha * se
        pmin <- phat - halfwidth
        pmax <- phat + halfwidth
        return(pmin, pmax)
}
Then we wrote an Splus function to compute the actual coverage probability for given p:
> Na0covprob
function(n, p, nominal)
{
# computes true cov prob of approx. confidence interval for binomial p
#   based on simple normal approx. with given "nominal" cov. prob.
#
        covprob.o <- 0
        covprob.c <- 0
        for(y in 0:n) {
                interval <- Na0int(n, y, nominal)
                if(interval[[1]] < p & p < interval[[2]])
                        covprob.o <- covprob.o + dbinom(y, n, p)
                if(interval[[1]] <= p & p <= interval[[2]])
                        covprob.c <- covprob.c + dbinom(y, n, p)
        }
        return(covprob.o, covprob.c)
}
We looped over the last one with n = 100, nominal coverage of tex2html_wrap_inline239 , and for p = 0, 0.01, 0.02, tex2html_wrap_inline275 , 0.99, 1.00. The results are plotted in Figures gif and gif. One sees that the actual coverage probability is above 0.90 for 0.09 < p < 0.91, and above 0.93 for 0.22 < p < 0.78.

   figure174
Figure: Plot of coverage probability for nominal 95% confidence interval of p from B(100,p) observation based on normal approximation to binomial.

   figure185
Figure: Plot of coverage probability for nominal 95% confidence interval of p from B(100,p) observation based on normal approximation to binomial for a smaller range of values of p.


next up previous
Next: About this document Up: No Title Previous: No Title

Dennis Cox
Mon Sep 15 17:13:26 CDT 1997