Learn R Programming

effectsize (version 0.3.1)

eta_squared: Effect size for ANOVA

Description

Functions to compute effect size measures for ANOVAs, such as Eta, Omega and Epsilon squared, and Cohen's f (or their partialled versions) for aov, aovlist and anova models. These indices represent an estimate of how much variance in the response variables is accounted for by the explanatory variable(s).

Effect sizes are computed using the sums of squares obtained from anova(model) which might not always be appropriate (Yeah... ANOVAs are hard...). See details.

Usage

eta_squared(model, partial = TRUE, ci = 0.9, ...)

omega_squared(model, partial = TRUE, ci = 0.9, ...)

epsilon_squared(model, partial = TRUE, ci = 0.9, ...)

cohens_f(model, partial = TRUE, ci = 0.9, ...)

Arguments

model

A model, ANOVA object, or the result of parameters::model_parameters.

partial

If TRUE, return partial indices.

ci

Confidence Interval (CI) level

...

Arguments passed to or from other methods (ignored).

Value

A data frame with the effect size(s) and confidence interval(s).

A data frame containing the effect size values and their confidence intervals.

Details

For aov and aovlist models, the effect sizes are computed directly with Sums-of-Squares. For all other model, the model is passed to anova(), and effect sizes are approximated via test statistic conversion (see F_to_eta2 for more details.)

Type of Sums of Squares

The sums of squares (or F statistics) used for the computation of the effect sizes is based on those returned by anova(model) (whatever those may be - for aov and aovlist these are type-1 sums of squares; for merMod these are type-3 sums of squares). Make sure these are the sums of squares you are intrested in (you might want to pass the result of car::Anova(mode, type = 3)).

It is generally recommended to fit models with contr.sum factor weights and centered covariates, for sensible results. See examples.

Confidence Intervals

Confidence intervals are estimated using the Noncentrality parameter method; These methods searches for a the best ncp (non-central parameters) for of the noncentral F distribution for the desired tail-probabilities, and then convert these ncps to the corresponding effect sizes.

Omega Squared

Omega squared is considered as a lesser biased alternative to eta-squared, especially when sample sizes are small (Albers \& Lakens, 2018). Field (2013) suggests the following interpretation heuristics:

  • Omega Squared = 0 - 0.01: Very small

  • Omega Squared = 0.01 - 0.06: Small

  • Omega Squared = 0.06 - 0.14: Medium

  • Omega Squared > 0.14: Large

Epsilon Squared

It is one of the least common measures of effect sizes: omega squared and eta squared are used more frequently. Although having a different name and a formula in appearance different, this index is equivalent to the adjusted R2 (Allen, 2017, p. 382).

Cohen's f

Cohen's f can take on values between zero, when the population means are all equal, and an indefinitely large number as standard deviation of means increases relative to the average standard deviation within each group. Cohen has suggested that the values of 0.10, 0.25, and 0.40 represent small, medium, and large effect sizes, respectively.

References

  • Albers, C., \& Lakens, D. (2018). When power analyses based on pilot data are biased: Inaccurate effect size estimators and follow-up bias. Journal of experimental social psychology, 74, 187-195.

  • Allen, R. (2017). Statistics and Experimental Design for Psychologists: A Model Comparison Approach. World Scientific Publishing Company.

  • Field, A. (2013). Discovering statistics using IBM SPSS statistics. sage.

  • Kelley, K. (2007). Methods for the behavioral, educational, and social sciences: An R package. Behavior Research Methods, 39(4), 979-984.

  • Kelley, T. (1935) An unbiased correlation ratio measure. Proceedings of the National Academy of Sciences. 21(9). 554-559.

The computation of CIs is based on the implementation done by Stanley (2018) in the ApaTables package and Kelley (2007) in the MBESS package. All credits go to them.

See Also

F_to_eta2

Examples

Run this code
# NOT RUN {
library(effectsize)
mtcars$am_f <- factor(mtcars$am)
mtcars$cyl_f <- factor(mtcars$cyl)

model <- aov(mpg ~ am_f * cyl_f, data = mtcars)

eta_squared(model)
omega_squared(model)
epsilon_squared(model)
cohens_f(model)
(etas <- eta_squared(model, partial = FALSE))

if(require(see)) plot(etas)


model <- aov(mpg ~ cyl_f * am_f + Error(vs / am_f), data = mtcars)
epsilon_squared(model)

# Recommended:
# Type-3 effect sizes + effects coding
if (require(car, quietly = TRUE)) {
  contrasts(mtcars$am_f) <- contr.sum
  contrasts(mtcars$cyl_f) <- contr.sum

  model <- aov(mpg ~ am_f * cyl_f, data = mtcars)
  model_anova <- car::Anova(model, type = 3)

  eta_squared(model_anova)
}

if (require("parameters")) {
  data(mtcars)
  model <- lm(mpg ~ wt + cyl, data = mtcars)
  mp <- model_parameters(model)
  eta_squared(mp)
}

if (require(lmerTest, quietly = TRUE)) {
  model <- lmer(mpg ~ am_f * cyl_f + (1|vs), data = mtcars)
  omega_squared(model)
}
# }

Run the code above in your browser using DataLab