Consider the following problem: A company manufacturing RAM chips claims the defective rate of the population is $5 \%$. Let $p$ denote the true defective probability. We want to test if:
- $H_{0}: p=0.05$
- $H_{1}: p>0.05$
We are going to use a sample of $100$ chips from the production to test.
Let $X$ denote number of defective chips in a sample of $100$.
Let us choose the critical value as $10$, that is we reject $H_0$ when $X \geq 10$ and do not reject $H_0$ when $X<10$.Now i am interested to find the corresponding level of significance $\alpha$.
We can do this using Binomial distribution as follows: $$\begin{aligned} \alpha &=\operatorname{Pr}(\text { Type I error })=\operatorname{Pr}\left(\text { reject } H_{0} \text { when } H_{0} \text { is true }\right) \\ &=\operatorname{Pr}(X \geq 10 \text { when } p=0.05) \\ &=\sum_{x=10}^{100} B(x ; n=100, p=0.05), \quad \text { binomial distribution } \\ &=\sum_{x=10}^{100}\left(\begin{array}{c} 100 \\ n \end{array}\right) 0.05^{x} 0.95^{100-x}=0.0282 \:\text{(Not sure how the author have calculated this)} \end{aligned}$$
Now i am trying to use Central Limit Theorem.
Let $X_i$ be a random variable that the $i$th chip is defective with Bernoulli's distribution with PMF: $$\begin{aligned} &\operatorname{Pr}\left(X_{i}=1\right)=0.05 \\ &\operatorname{Pr}\left(X_{i}=0\right)=0.95 \end{aligned}$$
We have:
$\mu=E[X_i]=0.05$ and $\sigma^2=Var[X_i]=0.0475$.
Also the sample size $n=100$.
Now $X=X_1+X_2+...X_{100}$ and let $\bar{X}$ be the sample mean.
So we have $$\operatorname{Pr}(X \geqslant 10)=\operatorname{Pr}(\bar{X} \geqslant 0.1)$$
$$\Rightarrow \operatorname{Pr}(X \geqslant 10)=\operatorname{Pr}\left(\frac{\bar{X}-0.05}{\frac{\sigma}{\sqrt{n}}} \geqslant \frac{0.1-0.05}{\frac{\sigma}{\sqrt{n}}}\right)=\operatorname{Pr}(Z \geqslant 2.29)=1-\Phi(2.29)=0.011$$
But the answer is $0.0282$. Where i went wrong?
pbinom
is a binomial CDF, code1 - pbinom(9, 100, .05)
returns $0.02818829.$ Surely the author did not use a normal approximation because the point is that the normal approximation works poorly for $\mathsf{Binom}(n−100,p=.05).$ – BruceET 20 mins ago $\endgroup$binom.test
to do an exact binomial test of $H_0: p=.05$ against $H_a: p>.05:$ In R, codebinom.test(10, 100, p=.05, alt="g")$p.val
returns P-value $0.02818829.$ $\endgroup$