Jump to a key chapter
Now, unlucky for you, the fire alarm doesn't go off, and before you know it, the flames have spread throughout the kitchen and you now can't get downstairs to call 999.
This is an example of a type II error which is also referred to as a false negative. There is a fire but the alarm doesn't go off. Similarly, in hypothesis testing, a type II error occurs when you do not reject the null hypothesis but the null hypothesis is in fact false.
What is a Type II error in Statistics?
Suppose you have carried out a hypothesis test and you do not reject the null hypothesis \(H_0\).
A type II error occurs when the null hypothesis is actually false or the alternative hypothesis, \(H_1\), is true.
This is different from a type I error which occurs when you reject the null hypothesis, but the null hypothesis is in fact true.
These two errors can be represented in the following table,
\(H_0\) true | \(H_1\) true | |
Reject \(H_0\) | Type I error | No error |
Do not reject \(H_0\) | No error | Type II error |
A type II error is also known as a false negative.
A type II error (false negative) is when you do not reject \(H_0\), but \(H_0\) is in fact false.
An example of a false negative is when someone tests for coronavirus and receives a result that says they are not infected, but they actually are.
Probability of a Type II Error
The probability of a type II error is denoted as \(\beta\) and to find the probability of a type II error, you need to know the true value of the parameter being tested, this will usually be given to you in the question.
The probability of a type II error is the probability of accepting the null hypothesis when it is false.
It can also be seen as the probability of not being in the critical region assuming the null hypothesis is false, and is given by the following formula,
\[\begin{align} \mathbb{P}( \text{Type II error})&=\mathbb{P}(\text{accepting } H_0 \text{ when } H_0 \text{ is false}) \\ &=\mathbb{P}(\text{not being in the critical region} \mid H_0 \text{ is false}) \end{align}\]
Probability of a Type II Error Examples
Consider a variable \(X\) with a Poisson distribution. A sample is taken, and a statistician wants to carry out the following hypothesis test, \(H_0: \lambda=9\) v.s. \(H_1:\lambda\neq9\), at the 5% significance level.
a) Find the critical region for this test.
b) Suppose that the true value of \(\lambda\) was later found to be 8, calculate the probability of a Type II error.
Solution
a) Since \(H_0: \lambda=9\) v.s. \(H_1:\lambda\neq9\), we are dealing with a two-tailed test.
Assume \(H_0\) is true, that is assume \(X\sim \text{Poi}(9)\).
Let \(X=c_1\) be the upper bound of the lower critical region. We want to find \(c_1\) such that \(\mathbb{P}(X \leq c_1)<0.0025\)
From the statistical tables,
\[\begin{align} \mathbb{P}(X \leq 4)&=0.0550>0.0025 \\ \mathbb{P}(X \leq 3)&=0.0212<0.0025 \end{align}\]
Therefore, \(c_1=3\).
Let \(X=c_2\) be the lower bound of the upper critical region. We want to find \(c_2\) such that \(\mathbb{P}(X \geq c_2)<0.0025\).
From the statistical tables,
\[\small{\begin{align} \mathbb{P}(X \geq 15)&=1-\mathbb{P}(X \leq 14)=1-0.9585=0.0415>0.0025 \\ \mathbb{P}(X \geq 16)&=1-\mathbb{P}(X \leq 15)=1-0.9780=0.0220<0.0025 \end{align}}\]
Therefore, \(c_2=16\).
So the critical region for this test is \({X\leq3}\) and \({X \geq 16}\).
b) Since we have the true value of \(\lambda=8\), we know that the null hypothesis is false so we can work out the probability of a type II error.
\(\begin{align} \mathbb{P}(\text{Type II error})&=\mathbb{P}(\text{accepting } H_0 \text{ when } H_0 \text{ is false}) \\ &=\mathbb{P}(4\leq X\geq 15 \mid H_0 \text{ is false}) \end{align}\)
Given that the true value of \(\lambda=8\),
\(\begin{align} \mathbb{P}( \text{ Type II error })&=\mathbb{P}(4 \leq X \geq 15\mid \lambda=8) \\ &=\mathbb{P}(X \geq 15 \mid \lambda=8)-\mathbb{P}(X \leq 3 \mid \lambda=8) \\ &=0.9918-0.0424=0.9494. \end{align}\)
Now we take another example.
Suppose someone claims that the average height of males in the U.S. is normally distributed with a mean of 70 inches and a standard deviation of 3 inches.
A statistician decides then to take a random sample of 36 males from the population of the U.S. in order to test this claim.
Let the random variable \(X\) denote the height of a male.
a) Using a significance level of 5%, find the critical region for this test.
b) Given that the average height was in fact 65 inches, find the probability that the person's claim is wrongly accepted.
Solution
a) We define the null hypothesis
\[H_0: \mu=70 \quad \text{v.s.} H_1: \mu\neq70.\]
Assume \(H_0\), then since \(X\) denotes the height of a male, the average height of males in the U.S. is distributed so that \(\bar{X} \sim N(70, 3^2/36)\).
Since we want to test using the mean of a normal random variable, to simplify things, we can use the result,
If \(\bar{X} \sim N(\mu,\sigma^2)\), then \(Z=\frac{\bar{X}-\mu}{\frac{\sigma}{\sqrt n}} \sim N(0,1)\).
Standardize this \(\bar{X}\) variable: \( Z=\frac{\bar{X}-70}{\frac{3}{\sqrt(36)}} = \frac{\bar{X}-70}{\frac{1}{2}}=2(\bar{X}-70)\) where the random variable \(Z \sim N(0, 1)\).
With a 5% significance level, since we have a two-tailed hypothesis test, we need 2.5% on each tail.
From the statistical tables, the critical region for \(Z\) is
\(Z > 1.9600\) or \(Z<-1.9600\)
So the critical values for \(\bar{X}\) are given by
\[2(\bar{X}-70)=\pm 1.96\]
\[\therefore \bar{X} = 69.02 \quad \text{and} \quad \bar{X} = 70.98\]
So the critical region for \(\bar{X}\) is \(\bar{X} <69.02\) or \(\bar{X} >70.98\)
b) If the person's claim for the average male height is accepted although the actual mean height turns out to be different, that is a Type II error.
\[\begin{align} \mathbb{P}(\text{Type II error})&=\mathbb{P}(69.02 \leq \bar{X} \leq 70.98 \mid \mu=65) \\ &=\mathbb{P}(\bar{X} \leq 70.98 \mid \mu=65)-\mathbb{P}(\bar{X} \leq 69.02 \mid \mu=65) \\ &=0.9769-0.9099\\&=0.067. \end{align}\]
Type II Error and the Power of a Test
The power of a hypothesis test is the probability of rejecting a false null hypothesis.
This is the probability statisticians are interested in, as the higher the power, the better the test. Therefore, a statistician aims to minimise the probability of a type II error to maximise the power of the test.
By updating the table shown earlier we have,
\(H_0\) true | \(H_1\) true | |
Reject \(H_0\) | Type I error | \(\text{Power} = 1 - \mathbb{P}(\text{Type II error})\) |
Do not reject \(H_0\) | No error | Type II error |
The power of a test is when \(H_0\) is false and a correct decision was made.
Its probability is given by,
\[\begin{align} \text{Power}&=1-\mathbb{P}(\text{Type II error})=1-\beta \\ &=\mathbb{P}(\text{being in the critical region when } H_0 \text{ is false}) \end{align}\]
Suppose a random variable \(X\) has a geometric distribution. A statistician wants to test the hypothesis \[H_0: p=0.05\quad \text{v.s.} \quad H_1: p\neq0.05\] using a 1% significance level.
a) Find the critical region for this test.
b) Now, given that \(p=0.03\), find the power of this test.
Solution
a) Assume we are under the null hypothesis, \(H_0\), so that \(X \sim \text{Geo}(0.05)\). Since this is a two-tailed test at the 1% significance level, if \(X=c_1\) is the lower bound of the upper critical region then, we need to find \(c_1\) such that \[\mathbb{P}(X \geq c_1)<0.005.\]
From the distribution of a geometric random variable, we have
\[\begin{align} (1-0.05)^{c_1-1}&<0.005 \\ c_1-1&>\frac{\ln(0.005)}{\ln(0.95)} \\ c_1&>104.29454 \end{align}\]
So \(c_1=104\) which gives an upper critical region of \(X \geq 104.\)
If \(X=c_2\) is the upper bound of the lower critical region then, we need to find \(c_2\) such that
\[\mathbb{P}(X \leq c_2)<0.005.\]
\[\begin{align} 1-(1-0.05)^{c_2}&<0.005 \\ 0.95^c_2&>0.995 \\ c_2&<\frac{\ln(0.995)}{\ln(0.95)} \\ c_2&<0.0977 \end{align}\]
So \(c_2=0.1\) which gives a lower critical region of \(X \leq 0.01.\)
b) The power of the test can be calculated via, \[ \begin{align} \text{Power }&= \mathbb{P}(H_0 \text{ is rejected} \mid p=0.03) \\ &=\mathbb{P}(X \leq 0.1 \mid p=0.03)+\mathbb{P}(X \geq 104 \mid p=0.03) \\ &=1-(1-0.03)^{0.1}+(1-0.03)^{104}=0.04513 \end{align}\]
Type II errors and Sample Size
The main determinant of a type II error is the sample size. The smaller the sample size, the higher the probability of a type II error.
Put another way, the greater the desired power of a test, the larger the sample size needed.
There can be a difficulty when deciding the correct sample size of a test since statisticians want to minimise the probability of a type II error but increasing the sample size increases the cost. Nevertheless, the most important way of minimising type II errors is to increase the sample size.
Type II Error - Key takeaways
- A type II error is when you do not reject \(H_0\), but \(H_0\) is in fact false.
A type II error is also known as a false negative and is denoted by \(\beta\).
\[\begin{align} \mathbb{P}( \text{Type II error})&=\mathbb{P}(\text{accepting } H_0 \text{ when } H_0 \text{ is false}) \\ &=\mathbb{P}(\text{not being in the critical region} \mid H_0 \text{ is false}) \end{align}\]
The power of a hypothesis test is the probability you correctly reject the null hypothesis and the hypothesis is false.
The type II error has an inverse relationship with the power of a hypothesis test, \(\text{Power}=1-\beta\).
Learn with 7 Type II Error flashcards in the free StudySmarter app
We have 14,000 flashcards about Dynamic Landscapes.
Already have an account? Log in
Frequently Asked Questions about Type II Error
How to calculate a type II error?
To calculate the probability of a type II error you will need the true value of the parameter of interest and the critical region of the test.
What is a type II error?
A type II error is when you do not reject the null hypothesis but the null hypothesis is false.
What is the probability of a type II error?
P(Type II error) = P( not being in the critical region given that H0 is false)
When does a type II error occur?
A type II error occurs in a statistical test when you erroneously do not reject H0 when it is in fact false.
About StudySmarter
StudySmarter is a globally recognized educational technology company, offering a holistic learning platform designed for students of all ages and educational levels. Our platform provides learning support for a wide range of subjects, including STEM, Social Sciences, and Languages and also helps students to successfully master various tests and exams worldwide, such as GCSE, A Level, SAT, ACT, Abitur, and more. We offer an extensive library of learning materials, including interactive flashcards, comprehensive textbook solutions, and detailed explanations. The cutting-edge technology and tools we provide help students create their own learning materials. StudySmarter’s content is not only expert-verified but also regularly updated to ensure accuracy and relevance.
Learn more