Theoretical Background: Confidence Interval for a Single Proportion
A confidence interval for a population proportion (\(p\)) provides an estimated range of values which is likely to include the unknown population proportion based on sample data. This is common in scenarios like opinion polls (proportion of voters favoring a candidate) or quality control (proportion of defective items).
Key Inputs and Point Estimate
- \(x\): The number of "successes" (observations with the characteristic of interest) in the sample.
- \(n\): The total sample size.
- \(\alpha\): The significance level (e.g., 0.05 for a 95% confidence interval).
The point estimate for the population proportion \(p\) is the sample proportion \(\hat{p}\):
1. Wald Interval (Normal Approximation Method)
The Wald interval is the most traditional method and relies on the normal approximation to the binomial distribution. It works well when the sample size is large and the proportion is not too close to 0 or 1.
The standard error of the sample proportion is estimated as:
The confidence interval is then calculated as:
Where \(Z_{\alpha/2}\) is the critical value from the standard normal distribution corresponding to the desired confidence level (e.g., for 95% CI, \(Z_{0.025} \approx 1.96\)).
Conditions for Normal Approximation: For the Wald interval to be reliable, it's generally recommended that both \(n\hat{p} \ge 10\) and \(n(1-\hat{p}) \ge 10\). If these conditions are not met, the Wald interval can be inaccurate, potentially yielding bounds outside [0, 1] or having poor coverage probability.
2. Wilson Score Interval
The Wilson score interval is an improvement over the Wald interval, especially for small sample sizes or when the proportion is close to 0 or 1. It has better coverage properties and always produces an interval within [0, 1].
The Wilson score interval is derived by solving the quadratic equation from \( \frac{|\hat{p} - p|}{\sqrt{p(1-p)/n}} \le Z_{\alpha/2} \). Its formula is more complex:
Alternatively, it can be written by first defining a modified sample proportion \(\tilde{p}\) and modified sample size \(\tilde{n}\):
The center of the Wilson interval is \(\tilde{p}\). The interval limits are:
The formula presented in the calculator uses the first, more direct form.
The Wilson interval is generally recommended as a good default choice due to its better performance across a wider range of scenarios compared to the Wald interval.
Interpreting the Confidence Interval
A \( (1-\alpha) \times 100\% \) confidence interval for \(p\) is interpreted as: "We are \( (1-\alpha) \times 100\% \) confident that the true population proportion \(p\) lies between the lower bound and the upper bound of the interval."
For instance, if a 95% confidence interval for the proportion of voters supporting a candidate is [0.52, 0.58], it means we are 95% confident that the true proportion of all voters supporting that candidate is between 52% and 58%.