An R Introduction to Statistics

Type II Error in Upper Tail Test of Population Mean with Known Variance

In a upper tail test of the population mean, the null hypothesis claims that the true population mean μ is less than a given hypothetical value μ0.

μ ≤ μ0

A type II error occurs if the hypothesis test based on a random sample fails to reject the null hypothesis even when the true population mean μ is in fact greater than μ0.

Assume that the population has a known variance σ2. By the Central Limit Theorem, the population of all possible means of samples of sufficiently large size n approximately follows the normal distribution. Hence we can compute the range of sample means for which the null hypothesis will not be rejected, and then obtain an estimate of the probability of type II error.

We demonstrate the procedure with the following:

Problem

Suppose the food label on a cookie bag states that there is at most 2 grams of saturated fat in a single cookie. Assume the actual mean amount of saturated fat per cookie is 2.09 grams, and the population standard deviation is 0.25 grams. At .05 significance level, what is the probability of having type II error for a sample size of 35 cookies?

Solution

We begin with computing the standard deviation of the mean, sem.

> n = 35                # sample size 
> sigma = 0.25          # population standard deviation 
> sem = sigma/sqrt(n); sem   # standard error 
[1] 0.042258

We next compute the upper bound of sample means for which the null hypothesis μ 2 would not be rejected.

> alpha = .05           # significance level 
> mu0 = 2               # hypothetical upper bound 
> q = qnorm(alpha, mean=mu0, sd=sem, lower.tail=FALSE); q 
[1] 2.0695

Therefore, so long as the sample mean is less than 2.0695 in a hypothesis test, the null hypothesis will not be rejected. Since we assume that the actual population mean is 2.09, we can compute the probability of the sample mean below 2.0695, and thus found the probability of type II error.

> mu = 2.09             # assumed actual mean 
> pnorm(q, mean=mu, sd=sem) 
[1] 0.31386

Answer

If the cookies sample size is 35, the actual mean amount of saturated fat per cookie is 2.09 grams and the population standard deviation is 0.25 grams, then the probability of type II error for testing the null hypothesis μ 2 at .05 significance level is 31.4%, and the power of the hypothesis test is 68.6%.

Exercise

Under same assumptions as above, if the actual mean amount of saturated fat per cookie is 2.075 grams, what is the probability of type II errors? What is the power of the hypothesis test?