View source: R/getDesignMeans.R
getDesignANOVA | R Documentation |
Obtains the power and sample size for one-way analysis of variance.
getDesignANOVA(
beta = NA_real_,
n = NA_real_,
ngroups = 2,
means = NA_real_,
stDev = 1,
allocationRatioPlanned = NA_real_,
rounding = TRUE,
alpha = 0.05
)
beta |
The type II error. |
n |
The total sample size. |
ngroups |
The number of treatment groups. |
means |
The treatment group means. |
stDev |
The common standard deviation. |
allocationRatioPlanned |
Allocation ratio for the treatment
groups. It has length |
rounding |
Whether to round up sample size. Defaults to 1 for sample size rounding. |
alpha |
The two-sided significance level. Defaults to 0.05. |
Let \{\mu_i: i=1,\ldots,k\}
denote the group means, and
\{r_i: i=1,\ldots,k\}
denote the randomization probabilities
to the k
treatment groups. Let \sigma
denote the
common standard deviation, and n
denote the total sample
size. Then the F
-statistic
F = \frac{SSR/(k-1)}{SSE/(n-k)}
\sim F_{k-1, n-k, \lambda},
where
\lambda = n \sum_{i=1}^k r_i (\mu_i - \bar{\mu})^2/\sigma^2
is the noncentrality parameter, and
\bar{\mu} = \sum_{i=1}^k r_i \mu_i
.
An S3 class designANOVA
object with the following
components:
power
: The power to reject the null hypothesis that
there is no difference among the treatment groups.
alpha
: The two-sided significance level.
n
: The number of subjects.
ngroups
: The number of treatment groups.
means
: The treatment group means.
stDev
: The common standard deviation.
effectsize
: The effect size.
allocationRatioPlanned
: Allocation ratio for the treatment
groups.
rounding
: Whether to round up sample size.
Kaifeng Lu, kaifenglu@gmail.com
(design1 <- getDesignANOVA(
beta = 0.1, ngroups = 4, means = c(1.5, 2.5, 2, 0),
stDev = 3.5, allocationRatioPlanned = c(2, 2, 2, 1),
alpha = 0.05))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.