power_seq | R Documentation |
This function calculates the power for a sequence of sample sizes using power
for two independent groups when the population standard deviation is assumed known and common across groups.
power_seq(mu0, mu1, sigma, alpha, n1, n2, n_vals)
mu0 |
Population mean of group 0 (e.g., control). |
mu1 |
Population mean of group 1 (e.g., experimental). |
sigma |
The population standard deviation, assumed equal across groups. |
alpha |
The Type I error rate. |
n1 |
The lowest number of samples to consider when generating a sequence of Type II errors. |
n2 |
The highest number of samples to consider when generating a sequence of Type II errors. |
n_vals |
The number of samples to generate Type II error for. |
Returns a series of length "n_vals" of calculated Type II error rates from n1 to n2.
# Set parameter values mu0 <- 0 mu1 <- 1 sigma <- 2 alpha <- 0.05 n1 <- 5 n2 <- 50 n_vals <- 10 # Calculate sequence seq_vals <- power_seq(mu0 = mu0, mu1 = mu1, sigma=sigma, alpha = alpha, n1 = n1, n2 = n2, n_vals = n_vals)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.