2
$\begingroup$

I was testing whether the proportion of successes from two populations is the same. It made me realize I only know how to do this with a normal approximation.

In particular, I would like to solve Exercise 9.3 from this set of exercises using a binomial distribution.

I understand that you may not feel like checking out my GitHub, so here's my problem in more general terms: suppose I flip a coin 100 times to test the hypothesis that the coin is unbiased. Instead of comparing the observed number of successes against the expected number of successes under $H_0$, I want to compare the observed proportion of successes against the expected proportion of successes. How can I test this without a normal approximation?

I found a post that suggests using Fisher's exact test. This is helpful in that it skips the normal approximation, but can this be done using a binomial test?

$\endgroup$

1 Answer 1

1
$\begingroup$

You have $x = 705$ successes in $n = 929$ failures, and you want to test $H_0: p = 3/4$ against $H_a: p \ne 3/4,$ at the 5% level. If $H_0$ is true, you expect about $627$ successes in $929$ trials. You will reject $H_0$ if the number $x$ of observed successes is far from $627$ in either direction.

Under $H_0,$ you have $X \sim \mathsf{Binom}(n =929, p=3/4).$ For a test at about the 5% level, you seek critical values $c_1$ and $c_2$ such that $P(X \le c_1\,|\, H_0) + P(X \ge c_2 \,|\, H_0) \approx 0.05.$

From R, where pbinom is a binomial CDF and qbinom is a binomial quantile function (inverse CDF), we have $P(X \le 670\, |\,H_0) = 0.0243$ and $P(X \ge 723\, |\,H_0) = 0.0244,$ so $c_1 = 670, c_2 = 723$ are suitable critical values.

qbinom(c(.025,.975), 929, 3/4)
[1] 671 722
pbinom(670, 929, 3/4)
[1] 0.02433703
1 - pbinom(722, 929, 3/4)
[1] 0.02441926

Therefore, if we observe $x = 705$ successes, with $c_1 = 670 < 705 < 723 = c_2,$ we do not reject $H_0.$

enter image description here

x = 625:775;  PDF = dbinom(x, 929, 3/4)
hdr = "PDF of BINOM(929, 3/4) with Normal Approx."
plot(x, PDF, type = "h", col="blue", main=hdr)
 abline(h=0, col="green2")
 abline(v=c(670.5, 721.5), col="red")
  mu = 929*.75;  sg = sqrt(929*.75*.25)
  curve(dnorm(x, mu, sg), add=T, lwd=2)

The approximating normal distribution to $\mathsf{Binom}(n=929,p=3/4)$ is $\mathsf{Norm}(\mu=696.75, \sigma=13.20);$ it provides a very close fit. With an approximate normal test, we would have used $c_1=670,c_2=723.$ which are not substantially different from the critical values of the exact normal test.

qnorm(c(.025,.975), mu, sg)
[1] 670.8824 722.6176
$\endgroup$
2
  • $\begingroup$ This is super helpful. Thank you for the visualization. However, is it possible to solve 9.3 with this methodology? This is the bit where I'm currently stuck at and had to resolve to using a normal approximation. $\endgroup$
    – Arturo Sbr
    Commented Mar 29, 2021 at 20:43
  • $\begingroup$ Please state the exact problem you are trying to solve instead of relying on interpretation of one problem among several related ones in a link. // An exact test of a difference of success probabilities e.g., (form men vs. women) may use Fisher's exact test and hence the hypergeometric distribution instead of binomial. $\endgroup$
    – BruceET
    Commented Mar 29, 2021 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.