Learn R Programming

AOboot (version 0.1.1)

AObootBetween: Bootstrapped ANOVA for Between-Subject 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 one-way and two-way ANOVAs following a between-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.).

Usage

AObootBetween(var.between,
              var.dv,
              var.id,
              levels.b1,
              levels.b2 = NULL,
              eff.si = c("pes", "ges"),
              data,
              silence = FALSE,
              n.sim = 1000,
              alpha = .05,
              seed = 1234,
              n.round = 2)

Value

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

Arguments

var.between

Variable(s) reflecting the between-subject level.

var.dv

Dependent variable.

var.id

Unique person specifier.

levels.b1

Levels of the first-named independent variable. Must be identical with the levels in the dataset.

levels.b2

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. "pes" reflects partial eta-squared, "ges" reflects eta-squared.

data

Name of the dataframe.

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.

Author

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

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.

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

Run this code
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 between-subjects ANOVA
# \donttest{
AObootBetween(
  var.between = "treatment",
  var.dv = "pre.1",
  var.id = "pers",
  levels.b1 = c("control", "A", "B"),
  eff.si = "ges",
  data = ao,
  n.sim = 1000,
  alpha = .05,
  seed = 1234,
  n.round = 2)
  # }

# Two-way between-subjects ANOVA
# \donttest{
AObootBetween(
  var.between = c("treatment", "gender"),
  var.dv = "pre.1",
  var.id = "pers",
  levels.b1 = c("control", "A", "B"),
  levels.b2 = c("M", "F"),
  eff.si = "pes",
  data = ao,
  n.sim = 1000,
  alpha = .05,
  seed = 1236,
  n.round = 2)
# }

Run the code above in your browser using DataLab