An R Introduction to Statistics

Type II Error in Two-Tailed Test of Population Mean with Known Variance

In a two-tailed test of the population mean, the null hypothesis claims that the true population mean μ is equal to 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 different from μ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 mean weight of King Penguins found in an Antarctic colony last year was 15.4 kg. Assume the actual mean population weight is 15.1 kg, and the population standard deviation is 2.5 kg. At .05 significance level, what is the probability of having type II error for a sample size of 35 penguins?

Solution

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

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

We next compute the lower and upper bounds of sample means for which the null hypothesis μ = 15.4 would not be rejected.

> alpha = .05           # significance level 
> mu0 = 15.4            # hypothetical mean 
> I = c(alpha/2, 1-alpha/2) 
> q = qnorm(I, mean=mu0, sd=sem); q 
[1] 14.572 16.228

Therefore, so long as the sample mean is between 14.572 and 16.228 in a hypothesis test, the null hypothesis will not be rejected. Since we assume that the actual population mean is 15.1, we can compute the lower tail probabilities of both end points.

> mu = 15.1             # assumed actual mean 
> p = pnorm(q, mean=mu, sd=sem); p 
[1] 0.10564 0.99621

Finally, the probability of type II error is the probability between the two end points.

> diff(p)               # p[2]-p[1] 
[1] 0.89056

Answer

If the penguin sample size is 35, the actual mean population weight is 15.1 kg and the population standard deviation is 2.5 kg, then the probability of type II error for testing the null hypothesis μ = 15.4 at .05 significance level is 89.1%, and the power of the hypothesis test is 10.9%.

Exercise

Under same assumptions as above, if actual mean population weight is 14.9 kg, what is the probability of type II errors? What is the power of the hypothesis test?