# Power of a hypothesis test

This demonstration shows the relationship between the Type I error (α), Type II error (β), difference in means ($\mu – \mu_0$), sample size (n), standard deviation ($\sigma_X$) and the power of a 2-sided hypothesis test.

1. The hypothesised distribution. The top curve shows the hypothesised distribution of the sample mean $\overline{X}$ under the null hypothesis $H_0: \mu = \mu_0$.
The region corresponding to a Type I error is shaded red.
You can change α, n and σ using the controls at the top-right corner.
2. The alternate distribution. When ready, click 'Show alternate distribution' to display an alternate distribution of the sample mean $\overline{X}$.
Click the ‘Show power’ checkbox to reveal the area (shaded green) corresponding to the power of the test.
Click the ‘Show Type II error region’ checkbox to reveal the area (shaded blue) corresponding to the probability of making a Type II error.

Drag the green point to change the alternate mean μ. Or press the ‘play’ button in the bottom-left corner to make it animate.

Use the ‘Vertical separation’ slider to superimpose or separate the two graphs. (This is purely visual, it has no effect on the hypothesis test.)

Other resources:

Online tutorial using this applet

Alternate version of the applet with large sample sizes

Geogebratube page for this applet