| simulate_anova | R Documentation |
Simulate a one-way group design
simulate_anova(
n = 30L,
means = NULL,
sds = 1,
labels = NULL,
outcome = "outcome",
seed = NULL,
batch = NULL
)
n |
Group sample size or one size per group, defaulting to |
means |
Group means. |
sds |
Group standard deviations. |
labels |
Optional group labels. |
outcome |
Name of the outcome variable. |
seed |
Optional random seed. |
batch |
Optional single positive whole number. When given, the
simulator runs |
A simulab_sim base data.frame with one row per observation and
columns id, group and outcome (renamed by outcome). Two tidy tables
come from as.data.frame(): what = "parameters" has one row per group
with columns group, n, mean and sd; what = "effects" has a single
row with columns grand_mean, between_sum_squares
(sum(n * (mean - grand_mean)^2)), within_sum_squares
(sum((n - 1) * sd^2)) and eta_squared, their ratio
between / (between + within). Because the within term uses the
degrees of freedom n - 1 rather than n, eta_squared is the
design's sum-of-squares eta-squared and differs slightly from the
variance-ratio population eta-squared.
result <- simulate_anova(n = 90, means = c(0, 0.4, 0.9), seed = 1)
head(result)
as.data.frame(result, what = "parameters")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.