Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

model_parameters.aov

Parameters from ANOVAs


Description

Parameters from ANOVAs

Usage

## S3 method for class 'aov'
model_parameters(
  model,
  omega_squared = NULL,
  eta_squared = NULL,
  epsilon_squared = NULL,
  df_error = NULL,
  type = NULL,
  ci = NULL,
  test = NULL,
  power = FALSE,
  verbose = TRUE,
  ...
)

Arguments

model

Object of class aov, anova, aovlist, Gam, manova, Anova.mlm, afex_aov or maov.

omega_squared

Compute omega squared as index of effect size. Can be "partial" (the default, adjusted for effect size) or "raw".

eta_squared

Compute eta squared as index of effect size. Can be "partial" (the default, adjusted for effect size), "raw" or "adjusted" (the latter option only for ANOVA-tables from mixed models).

epsilon_squared

Compute epsilon squared as index of effect size. Can be "partial" (the default, adjusted for effect size) or "raw".

df_error

Denominator degrees of freedom (or degrees of freedom of the error estimate, i.e., the residuals). This is used to compute effect sizes for ANOVA-tables from mixed models. See 'Examples'. (Ignored for afex_aov.)

type

Numeric, type of sums of squares. May be 1, 2 or 3. If 2 or 3, ANOVA-tables using car::Anova() will be returned. (Ignored for afex_aov.)

ci

Confidence Interval (CI) level for effect sizes omega_squared, eta_squared etc. The default, NULL, will compute no confidence intervals. ci should be a scalar between 0 and 1.

test

String, indicating the type of test for Anova.mlm to be returned. If "multivariate" (or NULL), returns the summary of the multivariate test (that is also given by the print-method). If test = "univariate", returns the summary of the univariate test.

power

Logical, if TRUE, adds a column with power for each parameter.

verbose

Toggle warnings and messages.

...

Arguments passed to or from other methods.

Value

A data frame of indices related to the model's parameters.

Note

For ANOVA-tables from mixed models (i.e. anova(lmer())), only partial or adjusted effect sizes can be computed.

Examples

if (requireNamespace("effectsize", quietly = TRUE)) {
  df <- iris
  df$Sepal.Big <- ifelse(df$Sepal.Width >= 3, "Yes", "No")

  model <- aov(Sepal.Length ~ Sepal.Big, data = df)
  model_parameters(
    model,
    omega_squared = "partial",
    eta_squared = "partial",
    epsilon_squared = "partial"
  )

  model_parameters(
    model,
    omega_squared = "partial",
    eta_squared = "partial",
    ci = .9
  )

  model <- anova(lm(Sepal.Length ~ Sepal.Big, data = df))
  model_parameters(model)
  model_parameters(
    model,
    omega_squared = "partial",
    eta_squared = "partial",
    epsilon_squared = "partial"
  )

  model <- aov(Sepal.Length ~ Sepal.Big + Error(Species), data = df)
  model_parameters(model)

  ## Not run: 
    if (require("lme4")) {
      mm <- lmer(Sepal.Length ~ Sepal.Big + Petal.Width + (1 | Species),
        data = df
      )
      model <- anova(mm)

      # simple parameters table
      model_parameters(model)

      # parameters table including effect sizes
      model_parameters(
        model,
        eta_squared = "partial",
        ci = .9,
        df_error = dof_satterthwaite(mm)[2:3]
      )
    }
  
## End(Not run)
}

parameters

Processing of Model Parameters

v0.13.0
GPL-3
Authors
Daniel Lüdecke [aut, cre] (<https://orcid.org/0000-0002-8895-3206>, @strengejacke), Dominique Makowski [aut] (<https://orcid.org/0000-0001-5375-9967>), Mattan S. Ben-Shachar [aut] (<https://orcid.org/0000-0002-4287-4801>), Indrajeet Patil [aut] (<https://orcid.org/0000-0003-1995-6531>, @patilindrajeets), Søren Højsgaard [aut], Zen J. Lau [ctb], Vincent Arel-Bundock [ctb] (<https://orcid.org/0000-0003-1995-6531>, @vincentab), Jeffrey Girard [ctb] (<https://orcid.org/0000-0002-7359-3746>, @jeffreymgirard)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.