Power curve of the Student t-test

Background

Let us draw two samples of $r_1$ and $r_2$ elements from two normal distributions $N(\mu_1, \sigma)$ and $N(\mu_2,\sigma)$, i.e. the variance is assumed to be equal. The $t$-statistic is:

$$ t=\frac{\bar{x}_1-\bar{x}_2}{\sqrt{\frac{1}{r_1}+\frac{1}{r_2}} \cdot \sqrt{\frac{(r_1-1)s_1^2+(r_2-1)s_2^2}{r_1+r_2-2}}}$$

where $\bar{x}_1$ and $\bar{x}_2$ are sample means, and $s_1^2$, $s_2^2$ are the unbiased sample variances. The $t$-statistic has Student $t$-distribution with $\nu=r_1+r_2-2$ degrees of freedom.

The power

The significance level is given and equals $1-\alpha$, where $\alpha$ is the probability of type I error. The difference is regarded as significant when $|\mu_1-\mu_2|\geq \delta$, where $\delta$ is given. The parameter $\delta$ does not appear directly but only as the noncentrality parameter (ncp) given by the formula:

$$ ncp = \frac{\delta}{\sigma\sqrt{\frac{1}{r_1}+\frac{1}{r_2}}}. $$

The power of the test is one less the probability of the type II error. The power curve is the graph of the power vs. $\delta$.

The plot of the power curve

This is the plot of the power vs. the noncentrality parameter.

A Monte-Carlo simulation of the power curve

Please refer to this page

R code