User:E527r21/sandbox

Power for two-sample t-tests
The power of a statistical test is the probability that the test rejects the null hypothesis when the alternative hypothesis is true. To calculate power for a two-sample t-test, the following information is required.


 * the difference between the means of the two groups
 * the within-group standard deviation for each group
 * the sample size (number of subjects) in each group
 * the required p-value for significance (alpha)

To calculate power, it can be useful to compute the standardized effect size. The standardized effect size is the ratio of the difference between the group means to the within-group standard deviation.

Standardized effect size = (μ1 - μ2)/ σ

where μ1 is the mean of group 1, μ2 is the mean of group 2, and σ is the standard deviation within each group.

For example, if the mean of group 1 is 14 and the mean of group 2 is 10, then the difference between group means is 14-10 = 4 units. Suppose that the standard deviation is 8 units. Then the standardized effect size is (14-10)/8 = 4/8 = 0.5.

The graph below shows power for standardized effect sizes from 0.1 to 1 for sample sizes per group from 10 to 50, assuming an equal number of subjects per group. N is the number of observations in each group.



From the graph, it can be seen that, for a standardized effect size of 0.5, a sample size of N = 10 per group gives power slightly less than 0.2. That is, the probability of rejecting the null hypothesis is about 0.2. A sample size of N = 50 per group gives power of approximately 0.7.