Finding type II error for testing mean in normal distribution

hypothesis testingprobabilitystatistics

Let's consider variable $X \sim N(\mu, 4)$. I want to check hypothesis $H_0:\mu=-1$ versus $H_1: \mu = 1$.

Critical region is given as $R = \{\overline{X}_n > c\}$

I want to find such $c$ that this test has size of $\alpha$ and I want to find probability of committing II type error.

My solution

Finding proper c

We are intereted in finidng such a C that $P_{\mu = -1}(\overline X_n > c) = 1 – \alpha$.

Assuming null hypothesis we know that $\frac{\overline X + 1}{\frac{2}{\sqrt n}} \sim N(0, 1)$. So:

$$P_{\mu = -1} (\overline X_n > c) = P_{\mu = -1}(\frac{\overline X_n + 1}{\frac{2}{\sqrt{n}}} > \frac{c + 1}{\frac{2}{\sqrt n}}) = 1 – P_{\mu = -1}(\frac{\overline X_n + 1}{\frac{2}{\sqrt{n}}} \le \frac{c + 1}{\frac{2}{\sqrt n}})$$
$$=1 – F_{N(0, 1)}(\frac{c + 1}{\frac{2}{\sqrt n}}) = 1 – \alpha$$

So the $c$ that we are searching for is formulated as:

$$c = \frac{2 q_{N(0, 1)}(1 – \alpha)}{\sqrt n} – 1$$

where $F_{N(0, 1)}$ and $q_{N(0, 1)}$ are respectively CDF and quantile function of standard normal distribution.

Finding probability of committing II type error

If we define our decision function as:

$$
\phi(x_1, …, x_n)=
\begin{cases}
1, & \textrm{when} \; (x_1, …, x_n) \in R \\
0, & \textrm{when} \; (x_1, …, x_n) \in R^c
\end{cases}
$$

II type error is probability of not rejecting null hypothesis when its false.

In other words we are searching for such a probablity that:

$$P_{\mu = 1}(\overline X < c) = P_{\mu = 1}(\frac{\overline X – 1}{\frac{2}{\sqrt n}} < \frac{c – 1}{\frac{2}{\sqrt n}}) = F_{N(0, 1)}(\frac{c – 1}{\frac{2}{\sqrt n}})$$

Do my calculations make sense to you?

Best Answer

Your answer for $c$ is correct, but your intermediate work contains errors.

As already stated in the comments, the type $I$ error probability is $$\Pr[\text{reject } H_0 \mid H_0] = \Pr[\bar X_n > c \mid \mu = -1] = \alpha, \tag{1}$$ whereas you wrote $P_{\mu = -1}(\bar X_n > c) = 1 - \alpha$. Then the equation you obtained $$1 - F_{N(0,1)}\left(\frac{c+1}{2/\sqrt{n}}\right) = 1 - \alpha \tag{2}$$ should actually be $$1 - F_{N(0,1)}\left(\frac{c+1}{2/\sqrt{n}}\right) = \alpha \tag{3}$$ in order for the result $$c = \frac{2 q_{N(0,1)}(1 - \alpha)}{\sqrt{n}} - 1 \tag{4}$$ to be correct. Your equation $(2)$ would give the incorrect result $$c = \frac{2 q_{N(0,1)}(\alpha)}{\sqrt{n}} - 1, \tag{5}$$ which we can see is wrong because for example, with $\alpha = 0.05$ and $n = 100$, Equation $(5)$ yields $c = -1.32897 < -1$ hence the rejection region for the test contains the null mean, which is absurd.

For the Type II error, your result is correct, but simplifies a little further: $$\beta = F_{N(0,1)} \left( \frac{c-1}{2/\sqrt{n}} \right) = F_{N(0,1)} \left( q_{N(0,1)}(1-\alpha) - \sqrt{n} \right).$$

Related Question