Finding sample size for type two error probability

97 Views Asked by At

Given that we know the standard deviation and the type two error probability for a two tailed test, how do we find the sample size? How do we go from $\Phi\left(\frac{\mu_0-\mu^{'}}{\frac{\sigma}{\sqrt{n}}}+Z_{\frac{\alpha}{2}}\right)-\Phi\left(\frac{\mu_0-\mu^{'}}{\frac{\sigma}{\sqrt{n}}}-Z_{\frac{\alpha}{2}}\right)=\beta$ $\quad$ to $\quad$ $n=\left[\frac{\sigma\left(Z_{\frac{\alpha}{2}-Z_{\beta}}\right)}{\mu-\mu^{'}}\right]^{2}$?

1

There are 1 best solutions below

0
On

Evidently, the author is trying to find $n$ so that $$\mathbb{P}\left(\frac{\mu_0-\mu'}{\sigma/\sqrt{n}}-z_{\alpha/2}< Z<\frac{\mu_0-\mu'}{\sigma/\sqrt{n}}+z_{\alpha/2}\right)<\beta$$ where $Z\sim \mathcal{N}(0,1)$.

If $\frac{\mu_0-\mu'}{\sigma/\sqrt{n}}>0,$ setting $\frac{\mu_0-\mu'}{\sigma/\sqrt{n}}+z_{\alpha/2}=z_{\frac{1-\beta}{2}}$ and solving for $n$ will give you a suitable sample size to make your type $\text{II}$ probability less than $\beta$. (You should draw a quick graph to see why this is true.)

Meanwhile, if $\frac{\mu_0-\mu'}{\sigma/\sqrt{n}}<0$, setting $\frac{\mu_0-\mu'}{\sigma/\sqrt{n}}-z_{\alpha/2}=-z_{\frac{1-\beta}{2}}$ and solving for $n$ will make the type $\text{II}$ error probability smaller than $\beta$.

You'll quickly realize after some algebra that these two expressions for $n$ coincide.