# [SOLVED]Probability of the error of type 2

#### mathmari

##### Well-known member
MHB Site Helper
Hey!! We have data of a sample of $100$ people from a population with standard deviation $\sigma=20$.

We consider the following test: \begin{align*}H_0 : \ \mu\leq 100 \\ H_1 : \ \mu>100\end{align*}

The real mean is $\mu=102$ and the significance level is $\alpha=0.1$.

I want to calculate the probability of the error of type 2.

I have done the following:

The statistic function is: \begin{equation*}Z=\frac{\overline{X}-\mu}{\sigma_{\overline{X}}}=\frac{\overline{X}-\mu}{\frac{\sigma}{\sqrt{n}}}=\frac{\overline{X}-100}{\frac{20}{\sqrt{100}}}=\frac{\overline{X}-100}{\frac{20}{10}}=\frac{\overline{X}-100}{2}\end{equation*}
where $\overline{X}$ is the estimation of $\mu$.

For the significance level $\alpha=0.1$ the critical value is $Z_{c} = 1.28$ and the region of rejection of $Η_0$ is $R = \{Z\mid Z > 1.28\}$.

The critical value $Z_{c}$ corresponds to a critical value $\overline{X}_{c}$ such that \begin{equation*}P\left (Z>1.28\right )=P\left (\overline{X}>\overline{X}_c \mid \mu=100 , \sigma_{\overline{X}}=2\right ) =1-\alpha=0.9\end{equation*}

We can find the value of $\overline{X}_c$ solving th following equation: \begin{equation*}Z_c=1.28 \Rightarrow \frac{\overline{X}_c-100}{2}=1.28 \Rightarrow \overline{X}_c-100=2.56 \Rightarrow \overline{X}_c=102.56\end{equation*}

So incorrectly we fail to reject the null hypothesis if we take a sample mean greater than $102.56$.

The probability to take a sample mean greater than $102.56$ given $\mu=102$ and $\sigma_{\overline{X}}=2$, i.e. the probability of error of type II is \begin{align*}P\left (\overline{X}>102.56\mid \mu=102, \sigma_{\overline{X}}=2\right )&=P\left (Z>\frac{102.56-102}{2}\right )=P\left (Z>\frac{0.56}{2}\right )=P\left (Z>0.28\right )\\ & =1-P\left (Z\leq 0.28\right )=1-0.6103=0.3897\end{align*}

Is everything correct? #### Klaas van Aarsen

##### MHB Seeker
Staff member
We can find the value of $\overline{X}_c$ solving th following equation: \begin{equation*}Z_c=1.28 \Rightarrow \frac{\overline{X}_c-100}{2}=1.28 \Rightarrow \overline{X}_c-100=2.56 \Rightarrow \overline{X}_c=102.56\end{equation*}

So incorrectly we fail to reject the null hypothesis if we take a sample mean greater than $102.56$.
Hey mathmari !!

If we fail to reject the null hypothesis, we keep the null hypothesis don't we?
Isn't that the case if we find a sample mean less than $102.56$? The probability to take a sample mean greater than $102.56$ given $\mu=102$ and $\sigma_{\overline{X}}=2$, i.e. the probability of error of type II is \begin{align*}P\left (\overline{X}>102.56\mid \mu=102, \sigma_{\overline{X}}=2\right )&=P\left (Z>\frac{102.56-102}{2}\right )=P\left (Z>\frac{0.56}{2}\right )=P\left (Z>0.28\right )\\ & =1-P\left (Z\leq 0.28\right )=1-0.6103=0.3897\end{align*}

Is everything correct?
I believe you have calculated the so called Power instead of the Type II error. #### mathmari

##### Well-known member
MHB Site Helper
If we fail to reject the null hypothesis, we keep the null hypothesis don't we?
Isn't that the case if we find a sample mean less than $102.56$? The error of type II is to accept the null hypothesis although it is wrong, isn't it?

I got stuck right now. We found the critival $\overline{X}$-value to be $102.56$ which is greater than $100$ and so we would accept the hypothesis $H_1$, or not? #### Klaas van Aarsen

##### MHB Seeker
Staff member
The error of type II is to accept the null hypothesis although it is wrong, isn't it?
Correct. I got stuck right now. We found the critival $\overline{X}$-value to be $102.56$ which is greater than $100$ and so we would accept the hypothesis $H_1$, or not?
Not quite.

Let's denote the critical $\overline{X}$-value as $\overline{X_0}^c$ to avoid confusion.
Note that $\overline{X_0}^c$ is calculated based on the null hypothesis for a certain significance level and sample size.
Now if we take a sample $x$ and its mean $\overline x$ is greater than $\overline{X_0}^c$, then we accept the alternative hypothesis, don't we?
And if $\overline x$ is less than $\overline{X_0}^c$, then we keep the null hypothesis, don't we? The Type II Error is the probability that a sample follows the alternative distribution, but has a mean so close to the null hypothesis that we keep the null hypothesis even though it is wrong.
In our case:
$$\beta = \text{Type II Error} = P(\overline X < \overline{X_0}^c \mid \mu = \mu_1 = 102)$$
where $\overline{X_0}^c$ is calculated based on the null hypothesis with $\mu=\mu_0=100$. #### mathmari

##### Well-known member
MHB Site Helper
Let's denote the critical $\overline{X}$-value as $\overline{X}^c$ to avoid confusion.
Now if we take a sample $x$ and its mean $\overline x$ is greater than $\overline{X}^c$, then we accept the alternative hypothesis, don't we?
And if $\overline x$ is less than $\overline{X}^c$, then we keep the null hypothesis, don't we? The Type II Error is the probability that a sample follows the alternative distribution, but has a mean so close to the null hypothesis that we keep the null hypothesis even though it is wrong.
In our case:
$$\beta = \text{Type II Error} = P(\overline X < \overline X^c \mid \mu = \mu_1 = 102)$$
where $\overline X^c$ is calculated based on the null hypothesis with $\mu=\mu_0=100$. Ah ok!! So do we have the following? \begin{equation*}\beta = P(\overline X < \overline X^c \mid \mu = \mu_1 = 102)=P\left (Z<\frac{102.56-102}{2}\right )=P\left (Z<\frac{0.56}{2}\right )=P\left (Z<0.28\right )=0.6103\end{equation*}

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Ah ok!! So do we have the following?

\begin{equation*}\beta = P(\overline X < \overline X^c \mid \mu = \mu_1 = 102)=P\left (Z<\frac{102.56-102}{2}\right )=P\left (Z<\frac{0.56}{2}\right )=P\left (Z<0.28\right )=0.6103\end{equation*}
Yep. #### mathmari

##### Well-known member
MHB Site Helper
Yep. Great!! Thanks a lot!! 