# Confidence Interval for Population Proportion. Clopper-Pearson Interval [closed]

I am sincerely stuck on this problem. Please help

alpha is 0.05 ## closed as off-topic by heropup, Claude Leibovici, user91500, Glorfindel, NamasteJul 27 '17 at 12:59

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – heropup, Claude Leibovici, user91500, Glorfindel, Namaste
If this question can be reworded to fit the rules in the help center, please edit the question.

• You have a binomial : defective/non-defective, with p=.08 , and sample size =25. Do you know how to use Normal approx here for a Normal interval? – gary Jul 26 '17 at 23:50
• @gary, Hi Gary, I understand this is a sample with a binomal RV, but I don't know how to derive a CI for it to be honest – Biu Jul 26 '17 at 23:54
• en.wikipedia.org/wiki/Binomial_proportion_confidence_interval – heropup Jul 27 '17 at 0:00
• @Biu, Hi, just by doing an interval as you would for a Normal, with mean =(25)(0.08) and s.d $p(1-p)$. – gary Jul 27 '17 at 0:01
• @Gary, p=2/25=0.08, so the success proportion refers to the number of defective boards, but the question is asking to find the CI for the true proportion of circuit boards in the lot from which the sample was drawn, is it referring to the non-defective boards? – Biu Jul 27 '17 at 0:05

## 1 Answer

A - Confidence interval with a Normal approximation:

$$\hat p\pm z_{1-\frac{\alpha}{2}}\ \sqrt{\frac{\hat p (1-\hat p)}{n}},\ \ \hat p=\frac{s}{n}$$

in which $s$ is the number of successes (defects in this case) and $n$ the number of boards. $z_{1-\frac{\alpha}{2}}$ is the quantile $1-\frac{\alpha}{2}$ of a standard Normal (e.g. close to 1.96 for $\alpha=0.05$, a 95% confidence probability).

Making the substitutions $s=2$, $n=25$ $\alpha=0.05$ leads to

$$\hat p\pm z_{1-\frac{\alpha}{2}}\ \sqrt{\frac{\hat p (1-\hat p)}{n}}=[-0.026,0.186]$$

Problem: this is a crude approximation, as $n=25$, the lower limit for the "true" frequency of defects is negative (-0.026), a non-sense.

B - Confidence interval - Clopper Pearson (see for instance, Bilder & Loughin  Categorical Data Analysis with R - CRC, page 15, for details)

This interval is exact and usually defined by quantiles of a Beta distribution by

$$[\text{QBeta}(\alpha/2, s,n-s+1), \text{QBeta}(1-\alpha/2, s+1,n-s)]$$

in the expression, QBeta is the quantile function of a beta, and the parameters in each function represents, respectively, the probability for the quantile, the first parameter of the Beta, and the second parameter of the beta.

Using $s=2$, $n=25$, $\alpha=0.05$ and the Beta quantile function from R, that is qbeta:

$$[\text{qbeta}(0.025,2,24), \text{qbeta}(0.975,3,23)]=[0.0098,0.2603].$$

In this case the limits for the confidence interval, 0.0098 and 0.2603, are not negative. It is a large interval due to a low $n$ (lots of uncertainty on the true frequency of defects).

• Thank you, this is really great, I was struggling with the Clopper Pearson, we had to study it on our own, and it is kicking my butt. Appreciate it. – Biu Jul 27 '17 at 2:01
• Can you help me with this? math.stackexchange.com/questions/2373154/… – Biu Jul 27 '17 at 4:29