Let \(X\) be the number of successes.
If \(n<<N\), then \(X\) is approximately binomial (i.e. approximating as if we are sampling with replacement). If \(n\) is large, \(X\) and \(\hat{p}=X/n\) are approximately normal.
Large Sample Tests
If \(np_{0}\ge10\) and \(n(1-p_{0})\ge10\) (recall these are the conditions for treating a binomial as a normal distribution).
\(H_{0}:p=p_{0}\)
Let the test statistic be:
(This is just \(z=\frac{\mu-\mu_{0}}{\sigma}\)).
- \(H_{a}:p>p_{0}\implies z\ge z_{\alpha}\)
- \(H_{a}:p<p_{0}\implies z\le-z_{\alpha}\)
- \(H_{a}:p\ne p_{0}\implies z\ge z_{\alpha/2}\) or \(z\le-z_{\alpha/2}\)
\(\beta\) and Sample Size Determination
When \(H_{0}\) is true, \(Z\) above is approximately standard normal. But what if \(p=p'\ne p_{0}\)? \(Z\) is still approximately normal (linear in \(\hat{p}\)). But the mean is not 0 and \(\sigma\ne 1\):
Let:
Then:
- \(H_{a}:p>p_{0},\beta(p')=\Phi(A+B_{\alpha})\)
- \(H_{a}:p<p_{0},\beta(p')=1-\Phi(A-B_{\alpha})\)
- \(H_{a}:p\ne p_{0},\beta(p')=\Phi(A+B_{\alpha/2})-\Phi(A-B_{\alpha/2})\)
The sample size \(n\) for \(\beta(p')=\beta\) (one-tailed):
For two tailed, replace \(\alpha\) with \(\frac{1}{2}\alpha\)
Small Sample Tests
When \(n\) is small, use the Binomial Distribution directly. If \(H_{0}\) is true, then \(p=p_{0}\) and the pmf is \(\textrm{Bin}(n,p_{0})\) The Type I error can be calculated directly.
If \(p=p'>p_{0}\), then the pmf=\(\textrm{Bin}(n,p')\) You can calculate the Type II error directly.