# I know how to discover the 95% confidence interval, but not 99%

I have a sample with 1000 people which 382 agree, 578 disagree and 40 can't decide. I want to find the 99% confidence interval of the proportion of people who agree.

I know how how to discover using R the standard error, and then use it to find the 95% confidence interval. It's just make this calculation: (0.382-2SE,0.382+2SE).

My question is how to find the 99% confidence interval. Do I need R programming or I can do as a simple calculation?

• en.wikipedia.org/wiki/68%E2%80%9395%E2%80%9399.7_rule Sep 4 '20 at 8:10
• @ericperkerson How can I find other values like 96.54% for example? do we have a way to do this using R programming? Sep 4 '20 at 8:13
• Yes, since you are using the normal approximation to find the 95% confidence level with ±2SE, you can run -qnorm((1-x)/2) in R to find how many standard deviations are required to get probability x. For example, -qnorm((1-0.99)/2) = 2.575829 tells you that ±2.57829SE will contain 99% of the area/probability under the standard normal distribution. Sep 4 '20 at 9:23

If you choose a significance level $$\alpha$$, you get a confidence interval with confidence level $$1-\alpha$$: $$C_{1-\alpha}=\left(X-z_{1-\frac{\alpha}{2}}\text{se},X+z_{1-\frac{\alpha}{2}}\text{se}\right)$$ where $$z_{1-\frac{\alpha}{2}}$$ is the $$(1-\frac{\alpha}{2})$$-quantile of a standard normal variable $$Z$$.

In your confidence interval, (0.382-2SE,0.382+2SE), that '2' actually is:

> alpha <- 0.05                     # significance level
> qnorm(1-alpha/2)
 1.959964


If you wish a $$0.99=1-0.01$$ confidence level, you replace '2' with:

> alpha <- 0.01
> qnorm(1-alpha/2)
 2.575829


If you are happy with R, you can use the binom.test function. E.g:

binom.test(382, 382+578+40, conf.level= 0.9654)

Exact binomial test

data:  382 and 382 + 578 + 40
number of successes = 382, number of trials = 1000, p-value = 8.291e-14
alternative hypothesis: true probability of success is not equal to 0.5
96.54 percent confidence interval:
0.3494766 0.415319
sample estimates:
probability of success
0.382


(although I'm not sure how the 40 undecided should be treated)