Confidence Interval for the Difference between Two Binomial Proportions

257 Views Asked by At

I have this stats problem where I am to create a 98% confidence interval for the difference between proportions. $X_1 = 21, n_1 = 90$ and $X_2 = 39, n_2 = 70.$

I did a 2propzinterval test and my confidence interval came out as $(-.497, -.151).$

The question is: A marketing manager claims that the proportion of customers who purchased pretzels did not change after the app campaign. Does the confidence interval contradict this claim?

How do I know if this confidence interval contradicts the claim? Thank you for your help!

2

There are 2 best solutions below

0
On

Not familiar with the intended technique. But I think the following method is good and it works without the Gaussian approximation. Assume $x_1\sim B(n_1,p_1)$ and $x_2\sim B(n_2,p_2)$ have the same probability $\,p_1=p_2=p$ and are independent. Then we have $$x_1+x_2\sim B(n_1+n_2,p),$$ and therefore the most likely value for $\,p\,$ is $\,p=\frac{x_1+x_2}{n_1+n_2}=\frac{3}{8}.$ Knowing $\,p\,$ makes the hypothesis test much easier. If the $\,n_1=90\,$ cases are randomly selected from $\,n_1+n_2=160$, the probability to have $x_1$ successful cases is given by

$$p(x_1|x_1+x_2=60)=\frac{{60\choose x_1}{100\choose90-x_1}}{{160\choose90}}.$$

Numerics shows that the $\,0.9864\,$ confidence range is $x_1\in[27,41]$. The biggest confidence range that does not includes $\,x_1=21\,$ is $\,x_1\in[22,46]$, which has a confidence level of $\,0.999965$. Thus the chance for $\,x_1(=21)\notin[22,46]$ is only $3.5\times 10^{-5}$ if $\,p_1=p_2$. This gives a statistically strong evidence for $p_1\neq p_2$.

0
On

The quick answer is that your 98% confidence interval $(-.497, -.151)$ does not contain $0$ (no change). So you would reject the null hypothesis $H_0: p_1 - p_2 = 0$ against the alternative hypothesis $H_a: p_1 - p_2 \ne 0$ at the 2% significance level.

Minitab statistical software does the test directly and also gives a confidence interval (at the requested confidence level), using a normal approximation, as follows:

Test and CI for Two Proportions 

Sample   X   N  Sample p
1       21  90  0.233333
2       39  70  0.557143

Difference = p (1) - p (2)
Estimate for difference:  -0.323810
98% CI for difference:  (-0.496531, -0.151088)
Test for difference = 0 (vs ≠ 0):  
    Z = -4.36  P-Value = 0.000

The Minitab 98% CI agrees with yours, so I assume you did your computations correctly.

The critical value for a test at the 2% level is 2.236, that is you would reject because $|Z| = 4.36 > 2.236.$ [The numbers $\pm 2.236$ cut 1% from the upper and lower tails (respectively) of the standard normal distribution.] You can also use the P-value $< 0.0005$ to reject $H_0$ at the 2% level because the P-value is less than 2%.

In summary, you have three equivalent ways to reject $H_0:$ (a) The (2-sided) 98% CI does not include $0$, (b) $|Z| > 2.236,$ and (c) the P-value is less than 2%.

Notes: (1) My guess is that you were expected to use the same method implemented in the Minitab procedure. Formulas for that method are shown in many elementary texts.

(2) However, the Answer by @ZhouranHe uses exact binomial probabilities. This is another correct approach (+1). (I have not checked the computations in that answer.)