Section 10.4 Interval Estimates - Confidence Interval for p
Sometimes selecting a value for p for a Binomial, Geometric, or Negative Binomial distribution problem can be done by using a theoretical value. Indeed, when flipping a coin it is reasonable to assume p = 1/2 is the probability of getting a head on one flip. Similarly, it is reasonable to assume p = 1/6 when you are looking for a particular side of a 6-sided die. However, many times you will want to deal with a problem in which it is not possible to determine exactly the precise value for the likelihood of success such as your true probability of making a free throw in basketball or knowing the true percentage of the electorate that will vote for your favorite candidate.
In these later situations, we found in the previous section that relative frequency \(\frac{Y}{n}\) is generally a good way to estimate p. In this section, you will investigate how to measure the closeness--and thereby assure some confidence in that estimate--regarding how well the point estimate approximates the actual value of p.
Definition 10.4.1. Confidence Intervals for p.
Given a point estimate \(\tilde{p}\) for p, a confidence interval for p is a range of values which contains the actual value of p with high probability. In notation, a two-sided confidence interval for p is of the form
with
where \(\alpha\) is near 0 and \(E_k \gt 0\text{.}\) One-sided confidence intervals for p can be similarly described
or
Generally, symmmetry is presumed when using a two-sided confidence interval so that \(E_1 = E_2 = E\) and therefore the interval looks like
In this case, E is known as the margin of error.
To determine E carefully, note that from the central limit theorem
is approximately standard normal for large n. Presuming that \(\tilde{p} \approx p\) and replacing the unknown p terms on the bottom with \(\tilde{p}\) gives
where z is a standard normal distribution variable. So, using the central limit theorem and the standard normal distribution, you can find the value \(z_{ \alpha/2}\) where
or by rearranging the inside inequality
Setting \(E = z_{ \alpha/2}\sqrt{\tilde{p}(1-\tilde{p})/n}\) gives a way to determine a confidence interval centered on \(\tilde{p} = \frac{Y}{n}\) for p with "confidence level" \(1-\alpha\text{.}\)
To complete the interval, one needs a specific value for \(z_{ \alpha/2}\text{.}\) Generally, one chooses confidence levels on the order of 90%, 95%, or 99% with 95% being the usual choice. Fortunately this value is easily computed using graphing calculators or other automatic methods although your ancient teacher might have been required to use tables. On a TI calculator, use
For 90% confidence level, you need to find a z-value so that
Using the symmetry of the normal distribution, this can be rewritten
Using the inverse of the standard normal distribution (on the TI calculator this is InvNorm(0.95)) gives \(z_{ 0.05} \approx 1.645\text{.}\)
Similarly, for a 95 % confidence level, find where
The calculators InvNorm(0.975) gives \(z_{ 0.025} \approx 1.960\text{.}\)
For a 99 % confidence level, find where
The calculators InvNorm(0.995) gives \(z_{ 0.005} \approx 2.576\text{.}\)
Notice that when computing the confidence intervals above that we choose to just replace some of the p terms with \(\tilde{p}\) so that only one p term was left and could be isolated in the middle. There are other ways to deal with this. The easiest is to take the worst case scenario for the p terms in the denominator above. Indeed, the confidence interval is made wider (and therefore more likely to contain the actual p) if the square root term is as large as possible, using basic calculus it is easy to see that p(1-p) is maximized when p = 1/2. Therefore, a second alternative is to create your confidence interval using
and therefore \(E = \frac{z_{ \alpha/2}}{2\sqrt{n}}\text{.}\) This method should be used only when trying to create the roughest and "safest" interval.
The methods for determining a confidence interval for p above depend upon a good approximation with the Central Limit Theorem. This approximation will be fine if n is relatively large. To consider a confidence interval for p when n is small, note that the binomial random variable is discrete and so expanding the interval by a factor of \(\frac{1}{2n}\) might be in order. Indeed, replace \(z_{\alpha/2}\) by \(t_{\alpha/2}(n-1)\) and continue otherwise.
Another more elaborate mechanism when n is relatively large is given by the Wilson Score. This confidence interval is more complicated than just taking \(\tilde{p}\) and adding and subtracting E. This approach notes that the possible extreme values for p must satisfy (before replacing some of the p terms with \(\tilde{p}\))
Theorem 10.4.2. Wilson Score Confidence Interval for p.
Proof.
Again, noting that \(\tilde{p} = \frac{Y}{n}\text{,}\) the expression above
can be simplified by squaring both sides to get
Replacing \(\tilde{p}\) with the relative frequency gives
or by simplifying
Solving for p using the quadratic formula and simplifying ultimately results in the described interval.
Example 10.4.3. Comparison of the three Confidence Interval methods for p.
Presume that from a sample of size n = 400 you get Y = 144 successes. Determine 95% two-sided confidence intervals for the actual p using all three of the methods above. Note that for each you will utilize \(z_{\alpha/2} = z_{0.025} = 1.960\) and \(\tilde{p} = \frac{144}{400} = 0.36\text{.}\)
Normal Interval:
or
or
or
So, there is a 95% chance that the actual value for p lies inside the interval \((0.31296 , 0.40704).\)
Maximal Interval:
or
or
Notice the interval is only slightly wider than when using \(\tilde{p}\) to estimate p in the first case.
Wilson Score Interval: Let's do this on in parts...
Therefore,
or
which is slightly different than the first and slightly smaller than the second.
Checkpoint 10.4.4. WebWork - Confidence Intervals.
Theorem 10.4.5. Determining Sample Size for proportions with a preliminary estimate.
Given a margin of error E and preliminary relative frequency estimate \(\tilde{p_0}\) the sample size needed to create the corresponding confidence interval is given by
Proof.
From the confidence interval
note that
Presuming E is given and n is unknown, simply solve for n (noting that n is an integer and therefore you will likely need to replace the equality with an appropriate inequality).
Theorem 10.4.6. Determining Sample Size for proportions with no preliminary estimate.
Given only a margin of error E, the sample size needed to create the corresponding confidence interval is given by
Proof.
Note that the maximum for \(y = x(1-x) \) occurs at \(x = 1/2, y = 1/4.\) Therefore, replacing \(\tilde{p_0}(1-\tilde{p_0} \le \frac{1}{4}\) gives the result.
Example 10.4.7. Determining Sample Size for one proportion.
Given a 99% confidence level, margin of error E=0.03, and preliminary estimate \(\tilde{p_0} = 0.35\text{,}\) notice that \(z_{\alpha / 2} = 2.58\) gives
or a sample size of at least 1683.