AObootMixed {AOboot}R Documentation

Bootstrapped ANOVA for Mixed Designs

Description

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.).

Usage

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)
            

Arguments

var.within

Variable(s) reflecting the within-subject level.

var.between

Variable(s) reflecting the between-subject level.

var.id

Unique person specifier.

levels.w1

Levels of the within-subjects variable. Must be identical with the levels in the dataset.

levels.b1

Levels of the between-subjects variable. Must be identical with the levels in the dataset.

eff.si

Effect size for the F-tests. pes reflects partial eta-squared, ges reflects eta-squared.

data

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.

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.

Details

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.

Value

type.aov

Type of ANOVA conducted.

factor1

Name of the groups in the between factor.

factor2

Name of the groups in the within factor.

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.1

Estimated marginal means for between factor.

em.2

Estimated marginal means for within factor.

em.3

Estimated marginal means for between factor by within factor.

em.4

Estimated marginal means for within factor by between factor.

no.test1

Number of post hoc tests for the between factor for which convergence was achieved.

no.test2

Number of post hoc tests for the within factor for which convergence was achieved.

no.test3

Number of post hoc tests for the between factor by within factor for which convergence was achieved.

no.test4

Number of post hoc tests for within factor by between factor for which convergence was achieved.

ph.1

Post hoc tests for between factor.

ph.2

Post hoc tests for within factor.

ph.3

Post hoc tests for between factor by within factor.

ph.4

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)

Author(s)

Lisa-Marie Segbert, Christian Blötner c.bloetner@gmail.com

References

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>

Examples

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

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)


[Package AOboot version 0.1.2 Index]