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 Mixed ANOVAs. 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.).
AObootMixed(var.within,
var.between,
var.id,
levels.w1,
levels.b1,
eff.si = c("pes", "ges"),
data,
silence = FALSE,
n.sim = 1000,
alpha = .05,
seed = 1234,
n.round = 2)Type of ANOVA conducted.
Name of the groups in the between factor.
Name of the groups in the within factor.
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.
Estimated marginal means for between factor.
Estimated marginal means for within factor.
Estimated marginal means for between factor by within factor.
Estimated marginal means for within factor by between factor.
Number of post hoc tests for the between factor for which convergence was achieved.
Number of post hoc tests for the within factor for which convergence was achieved.
Number of post hoc tests for the between factor by within factor for which convergence was achieved.
Number of post hoc tests for within factor by between factor for which convergence was achieved.
Post hoc tests for between factor.
Post hoc tests for within factor.
Post hoc tests for between factor by within factor.
Post hoc tests for within factor by between factor.
output <- list(type.aov = "Two-way mixed ANOVA", factor1 = levels.b1, factor2 = levels.w1, anova = round(orig.aov$anova_table, n.round), em.1 = dat.em1, no.test1 = no.test1, ph.1 = dat.ph1, em.2 = dat.em2, no.test2 = no.test2, ph.2 = dat.ph2, em.3 = dat.em3, no.test3 = no.test3, ph.3 = dat.ph3, em.4 = dat.em4, no.test4 = no.test4, ph.4 = dat.ph4)
Variable(s) reflecting the within-subject level.
Variable(s) reflecting the between-subject level.
Unique person specifier.
Levels of the within-subjects variable. Must be identical with the levels in the dataset.
Levels of the between-subjects variable. Must be identical with the levels in the dataset.
Effect size for the F-tests. pes reflects partial
eta-squared, ges reflects eta-squared.
Name of the dataframe. The dataset must be in a wide-format, with
one row per participant. If the original data is available in long format, we
advise users to apply the longToWide() function from the lsr
package to convert data to wide format.
Logical. If FALSE, progress of the bootstrapping procedure will be displayed.
Number of bootstrap samples to be drawn.
Type I error.
To make the results reproducible, it is recommended to set a random seed parameter.
Number of digits in the output.
Lisa-Marie Segbert, Christian Blötner c.bloetner@gmail.com
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.
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)
# Mixed ANOVA
# \donttest{
AObootMixed(
var.within = c("pre.1", "post.1", "fup.1"),
var.between = "treatment",
var.id = "pers",
levels.w1 = c("pre", "post", "fup"),
levels.b1 = c("control", "A", "B"),
eff.si = "pes",
data = ao,
n.sim = 1000,
alpha = .05,
seed = 1234,
n.round = 2)
# }
Run the code above in your browser using DataLab