# Hypothesis testing of binomialy distributed data

I haven't done any hypothesis testing for years since I left school and I just wanted to refresh my memory of it.

The hypothesis is stated as following: Assume that average high school student has a dropout rate of 70%. Alternative hypothesis would be that the dropout rate is less than 70%. Since student can only either stay in school or leave we can model that using Binomial distribution, when we sample.

Thus, we have:

Suppose $$\theta$$ is the probability that a student stays in school. Then

$$H_0 : \theta = 0.7 \quad \text{vs.} \quad H_a : \theta < 0.7.$$

The test statistic we will use is based on the binomial distribution. $$X$$ is the number of students in $$n$$ cases that stayed in school, then $$X \mid H_0 \sim \operatorname{Binomial}(n, \theta = 0.7).$$

Then I sample, say, $$100$$ students and count how many of them actually stayed in school. We observe that $$57$$ of them stay in school. Then, $$p$$ value would be $$p = \Pr[X \le 57 \mid H_0] = 0.00396779$$ Can we use normal approximation in this case? Also, what type of test would I need to use then? Left-sided?

Thanks!

• $p(H_0)=0,$ right variant $H_0: \theta \geq 0.7$. – Yuri Negometyanov Dec 13 '18 at 1:54

## 1 Answer

If we were to apply a normal approximation, we would model X as

$$X|H_{0}\sim\mathcal{N}\left(n\theta,n\theta\left(1-\theta\right)\right)$$

$$X|H_{0}\sim\mathcal{N}(70,21)$$

$$\sigma=\sqrt{21}$$

Thus, our p-value, under normal approximation, would be $$\mathbb{P}(Z<\frac{\left(57-70\right)}{\sqrt{21}})$$

This is a one sided Z-test, and we get a p value of 0.002327, which as you can see is quite a bit lower than yours(but is a nice quick order of magnitude approximation if you're away from a computer). It is well known that normal approximations to binomial give p values that smaller than they should be when we are deep into the tails. With only 100 people, you really don't need to apply a normal approximation

• What if I have, let's say 10000 people? What is an appropriate condition to apply normal approximation? – Zakkery Dec 12 '18 at 19:20
• A stirling approximation would be better, $$\left(\begin{array}{c} n\\ i \end{array}\right)\approx\frac{n^{i}}{i!}$$ $$\mathbb{P}\left(X<m\right)=\sum_{i=0}^{m}\left(\begin{array}{c} n\\ i \end{array}\right)p^{i}\left(1-p\right)^{n-i} \approx\sum_{i=0}^{m}\frac{n^{k}}{i!}p^{i}\left(1-p\right)^{n-i}$$ Should be a little bit easier than binomial to compute. A normal won't be bad as long as you aren't too too far in the tail--just keep in mind that if you have something like $p=10^{-6}$, you're probably underestimating the p value by using a normal approximation. – Alex Dec 12 '18 at 19:49
• Also, to answer the question of when the normal approximation is good, it will be good with a sample size of 10,000 up to very deep into the tails, and it is more accurate when $\theta$ is closer to 0.5 as the distribution will be more symmetric. – Alex Dec 12 '18 at 23:20