mu0
(H_{0}: mu0 = mu1, H_{1}: mu0 <> mu1).sample.power(mu0 = 0, mu1 = 0, sigma = 1, n = 100, alpha = 0.05)
n
the sample size;
sigma
the standard deviation;
SE
the standard error of the mean;
mu0
the mean of H_{0} in the population;
mu1
the sample mean;
mean.crit
the critical value of sample mean to achieve significance;
ES
the population "effect" size gamma;
delta
the effect size delta (Cohen);
alpha
the significance level alpha (twosided);
power
the power (1-beta).sample.power
calculates the power of a one-sample z-test (twosided)
and plots the density distributions under the assumption of of H_{0}: m = mu0 and
H_{1}: m = mu1. The rejection regions of H_{0} (alpha) are colored blue, while the rejection region of H_{1} (beta) is colored red.sample.power(mu0=68, mu1=69, sigma=3.1, n=100)
## gives a power of .90
Run the code above in your browser using DataLab