p_anova.test | R Documentation |
Generates continuous multi-sample data to be analyzed by
a one-way ANOVA, and return a p-value.
Uses the function oneway.test
to perform the analyses.
The data and associated
test assume that the conditional observations are normally distributed and have
have equal variance by default, however these may be modified.
p_anova.test(
n,
k,
f,
n.ratios = rep(1, k),
two.tailed = TRUE,
var.equal = TRUE,
means = NULL,
sds = NULL,
gen_fun = gen_anova.test,
...
)
gen_anova.test(n, k, f, n.ratios = rep(1, k), means = NULL, sds = NULL, ...)
n |
sample size per group |
k |
number of groups |
f |
Cohen's f effect size |
n.ratios |
allocation ratios reflecting the sample size ratios. Default of 1 sets the groups to be the same size (n * n.ratio) |
two.tailed |
logical; should a two-tailed or one-tailed test be used? |
var.equal |
logical; use the pooled SE estimate instead of the Welch correction for unequal variances? |
means |
(optional) vector of means. When specified the input |
sds |
(optional) vector of SDs. When specified the input |
gen_fun |
function used to generate the required data.
Object returned must be a |
... |
additional arguments to be passed to |
a single p-value
Phil Chalmers rphilip.chalmers@gmail.com
gen_anova.test
# n=50 in 3 groups, "medium" effect size
p_anova.test(50, k=3, f=.25)
# explicit means/sds
p_anova.test(50, 3, means=c(0,0,1), sds=c(1,2,1))
# compare simulated results to pwr package
pwr::pwr.anova.test(f=0.28, k=4, n=20)
p_anova.test(n=20, k=4, f=.28) |> Spower()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.