AObootWithin {AOboot} | R Documentation |
In case of violations of the assumption of the normal distribution, researchers
usually employ bootstrapping. Based on the R
packages
afex and
emmeans, this function
computes bootstrapped confidence intervals for the effect sizes, estimated
marginal means, and post hoc tests for one-way and two-way ANOVAs following a
within-subject design. Furthermore, the p-values of the F-statistic are adjusted
to reflect the probability to obtain equal or higher values than the raw,
non-bootstrapped ANOVA (Stine, 1989 <doi:10.1177/0049124189018002003>; see
also this tutorial by Nadine Spychala.).
AObootWithin(var.within,
var.id,
levels.w1,
levels.w2 = NULL,
eff.si = c("pes", "ges"),
data,
silence = FALSE,
n.sim = 1000,
alpha = .05,
seed = 1234,
n.round = 2)
var.within |
Variable(s) reflecting the within-subject level. |
var.id |
Unique person specifier. |
levels.w1 |
Levels of the first-named independent variable. Must be identical with the levels in the dataset. |
levels.w2 |
For two-way ANOVAs. Levels of the second-named independent variable. Must be identical with the levels in the dataset. |
eff.si |
Effect size for the F-tests. |
data |
Name of the dataframe. The dataset must be in a wide-format, with one row per participant. |
silence |
Logical. If FALSE, progress of the bootstrapping procedure will be displayed. |
n.sim |
Number of bootstrap samples to be drawn. |
alpha |
Type I error. |
seed |
To make the results reproducible, it is recommended to set a random seed parameter. |
n.round |
Number of digits in the output. |
The p-value of the F-test (Pr(>F)
) in the output reflects the
probability to obtain an F-value as high as or higher than the F-value from the
raw, non-bootstrapped ANOVA. Thus, it should not be mistaken as a p-value in the
sense of a null hypothesis significance test. More information about this can be
found in this tutorial by Nadine Spychala.
type.aov |
Type of ANOVA conducted. |
factor |
Name of the groups in the factor (in one-way ANOVA). |
factor1 |
Name of the groups in the first factor (in two-way ANOVA). |
factor2 |
Name of the groups in the second factor (in two-way ANOVA). |
anova |
Results of the conducted ANOVA (i.e., degrees of freedom, F-test, p-value, effect size with bootstrap confidence interval, and numbers of tests for which convergence was achieved. |
em |
Estimated marginal means in one-way ANOVA. |
em.1 |
Estimated marginal means for factor 1 in two-way ANOVA. |
em.2 |
Estimated marginal means for factor 2 in two-way ANOVA. |
em.3 |
Estimated marginal means for factor 1 by factor 1 in two-way ANOVA. |
em.4 |
Estimated marginal means for factor 2 by factor 1 in two-way ANOVA. |
no.test |
Number of post hoc tests in one-way ANOVAs for which convergence was achieved. |
no.test1 |
Number of post hoc tests for factor 1 in two-way ANOVAs for which convergence was achieved. |
no.test2 |
Number of post hoc tests for factor 2 in two-way ANOVAs for which convergence was achieved. |
no.test3 |
Number of post hoc tests for factor 1 by factor 2 in two-way ANOVAs for which convergence was achieved. |
no.test4 |
Number of post hoc tests for factor 2 by factor 1 in two-way ANOVAs for which convergence was achieved. |
ph |
Post hoc tests in one-way ANOVAs. |
ph.1 |
Post hoc tests for factor 1 in two-way ANOVAs. |
ph.2 |
Post hoc tests for factor 2 in two-way ANOVAs. |
ph.3 |
Post hoc tests for factor 1 by factor 2 in two-way ANOVAs. |
ph.4 |
Post hoc tests for factor 2 by factor 1 in two-way ANOVAs. |
Lisa-Marie Segbert, Christian Blötner c.bloetner@gmail.com
Stine, R. (1989). An introduction to bootstrap methods: Examples and ideas. Sociological Methods & Research, 18(2-3), 243–291. <https://doi.org/10.1177/0049124189018002003>
library(carData)
# The OBrienKaiser dataset from the carData package
ao <- OBrienKaiser
# Add a unique person identifier to the dataset
ao$pers <- 1:nrow(OBrienKaiser)
# One-way within-subjects ANOVA
AObootWithin(
var.within = c("pre.1", "post.1", "fup.1"),
var.id = "pers",
levels.w1 = c("pre", "post", "fup"),
eff.si = "ges",
data = ao,
n.sim = 1000,
alpha = .05,
seed = 1234,
n.round = 2)
# Two-way within-subjects ANOVA
AObootWithin(
var.within = c("pre.1", "pre.2", "pre.3", "pre.4", "pre.5",
"post.1", "post.2", "post.3", "post.4", "post.5",
"fup.1", "fup.2", "fup.3", "fup.4", "fup.5"),
var.id = "pers",
levels.w1 = c("pre", "post", "fup"),
levels.w2 = c("1", "2", "3", "4", "5"),
eff.si = "pes",
data = ao,
n.sim = 1000,
alpha = .05,
seed = 1234,
n.round = 2)