Interactive Demonstrations for Statistics Education on the World Wide Web

R. Webster West and R. Todd Ogden
University of South Carolina

Journal of Statistics Education v.6, n.3 (1998)

Copyright (c) 1998 by R. Webster West and R. Todd Ogden, all rights reserved. This text may be freely shared among individuals, but it may not be republished in any medium without express written consent from the authors and advance notification of the editor.

Power of a Hypothesis Test Applet

This applet illustrates the fundamental principles of statistical hypothesis testing through the simplest example: the test for the mean of a single normal population, variance known (the Z test).

The basic set-up of the test is this: using only n independent observations X1, X2,..., Xn from a normal distribution with unknown mean (but known variance), the task is to decide whether or not to reject a null hypothesis $H_{0} : \mu = \mu_{0}$ in favor of some alternative hypothesis. In most applications, there are only three alternative hypotheses of interest:

  1. $H_{a} : \mu > \mu_{0}$
  2. $H_{a} : \mu < \mu_{0}$
  3. $H_{a} : \mu \neq \mu_{0}$
These hypotheses are, respectively, "upper-tailed," "lower-tailed," and "two-tailed." The testing framework consists of computing a test statistic

\[Z = \frac{\overline{X} - \mu_{0}}{\sigma / \sqrt{n}}\],

and then rejecting the null hypothesis if the appropriate condition is satisfied. In the order of the alternative hypotheses above, the null hypothesis is rejected if

  1. $Z > z_{\alpha}$ ,
  2. $Z < -z_{\alpha}$ ,
  3. $\left\vert Z \right\vert > z_{\alpha/2}$ ,
where $z_{\alpha}$ represents the upper $\alpha$ critical point of the standard normal distribution.

This hypothesis testing procedure is set up to give the null hypothesis the "benefit of the doubt;" that is, to not reject the null hypothesis unless there is strong evidence to support the alternative. If H0 is true, the above test statistic follows a standard normal distribution, so the probability of erroneously rejecting H0 is just $\alpha$. If Ha is true, however, the test statistic Z does not follow a standard normal distribution -- it follows a normal distribution with a different mean, and thus, the probability of (correctly) rejecting the null hypothesis is larger than $\alpha$. This probability is knows as the power of the test, and it depends on the true value of $\mu$. (Clearly, a test would have more power for an extreme value of $\mu$ than for a $\mu$ that is very close to $\mu_{0}$.)

To use this applet, you must specify the hypothesized mean $\mu_{0}$, the true mean $\mu$, and the value of $\sigma$, and select the appropriate alternative hypothesis. Clicking on the Show it! button will give a plot. The black curve represents the distribution of the test statistic when the null hypothesis is true. The portion shaded in red represents the probability of falling beyond the cut-off point(s) when the null hypothesis is true (the Type I error rate, or $\alpha$). The blue curve represents the distribution of the test statistic under the particular value of $\mu$ you selected. The blue shaded area represents the power of the test for that particular value of $\mu$. Note that the region shaded both blue and red appears purple.

Return to West and Ogden Paper | Return to Table of Contents | Return to the JSE Home Page