power.z.test: Power analysis for a one sample z-test
Description
A power analysis for a one sample z-test. The function requires alpha, sigma,
the effect size, the type of test (one tailed or two-tailed), and either power
(1 - beta) or n (sample size). If n is provided, then power is calculated. Conversely,
if one provides power, but not n, then n is calculated.
Usage
power.z.test(sigma = 1, n = NULL, power = NULL, alpha = 0.05, effect = NULL,
test = c("two.tail", "one.tail"))
Arguments
sigma
The population variance
n
The sample size. Not required if power is specified.
power
The desired power. Not required if n is specified.
alpha
Probability of type I error.
effect
Effect size.
test
One of two choices: "two.tail" or "one.tail".
Value
Returns a list
sigmaThe prescribed population variance.
nThe sample size.
powerThe power.
alphaThe type I error probability.
testThe type of test prescribed.
effectThe effect size.
References
Bain, L. J., and M. Engelhardt (1992) Introduction to probability and mathematical
statistics. Duxbury press. Belmont, CA, USA.