Predicting statistical power for the Z-test
The population mean (μ0) for the concentration of copper in blood of llamas was taken as 8.72 μmol/litre with the population standard deviation of observations as 1.3825. We ask what would be the probability of a one-tailed Z-test correctly rejecting the null hypothesis when comparing a mean of sample size = 4 drawn from a population with a mean μ1 of 9.59 μmol/litre.
Power = P[Z > 1.6449 − (9.59 − 8.72) / (1.3825 / √4)]
= P[Z > 0.3863 ]
We can conclude that the chance of getting a significant result with a one-tailed test is only 35%.
Using exactly the same parameters as the example above, we ask what would be the probability of a two-tailed Z-test correctly rejecting the null hypothesis.
|Power = ||P[ Z > 1.96 − (9.59 − 8.72) / (1.3825/√4) ] + 1 − P[ Z > −1.96 − (9.59 − 8.72) / (1.3825/√4) ]
|= ||P[Z > 0.7014] + 1 − P[ Z > −3.2186]
|= ||0.2415 + 1 − 0.999356
We can conclude that the chance of getting a significant result with a two-tailed test is only 24.21%. Note that the probability of a Type III error here is very small at only 0.0006, so it has little effect on the power calculation.
Clearly if we only took four samples, our test would have very little power to reject the null hypothesis. The question then is how many samples would be required to give us a reasonable chance (say 80%) of rejecting the null hypothesis. We could use repeated estimates of the power for different sample sizes to produce a power curve:
The required number of samples for a power of 80% could then be read of the graph - in this case we would need around 20 samples. But it would be a lot easier to rearrange the equation, and estimate the required number of samples directly.
Estimating required sample size for the Z-test
Sample size calculations for a two-tailed test are identical except that you use the z values at α/2 instead of α.