Learn R Programming

sjstats (version 0.17.7)

anova_stats: Effect size statistics for anova

Description

Returns the (partial) eta-squared, (partial) omega-squared, epsilon-squared statistic or Cohen's F for all terms in an anovas. anova_stats() returns a tidy summary, including all these statistics and power for each term.

Usage

anova_stats(model, digits = 3)

cohens_f(model)

epsilon_sq(model, ci.lvl = NULL, n = 1000, method = c("dist", "quantile"))

eta_sq(model, partial = FALSE, ci.lvl = NULL, n = 1000, method = c("dist", "quantile"))

omega_sq(model, partial = FALSE, ci.lvl = NULL, n = 1000, method = c("dist", "quantile"))

Arguments

model

A fitted anova-model of class aov or anova. Other models are coerced to anova.

digits

Number of decimal points in the returned data frame.

ci.lvl

Scalar between 0 and 1. If not NULL, returns a data frame with effect sizes including lower and upper confidence intervals.

n

Number of bootstraps to be generated.

method

Character vector, indicating if confidence intervals should be based on bootstrap standard error, multiplied by the value of the quantile function of the t-distribution (default), or on sample quantiles of the bootstrapped values. See 'Details' in boot_ci(). May be abbreviated.

partial

Logical, if TRUE, the partial eta-squared is returned.

Value

A data frame with the term name(s) and effect size statistics; if ci.lvl is not NULL, a data frame including lower and upper confidence intervals is returned. For anova_stats(), a tidy data frame with all statistics is returned (excluding confidence intervals).

Details

For eta_sq() (with partial = FALSE), due to non-symmetry, confidence intervals are based on bootstrap-methods. In this case, n indicates the number of bootstrap samples to be drawn to compute the confidence intervals. Confidence intervals for partial omega-squared and epsilon-squared is also based on bootstrapping.

Since bootstrapped confidence intervals are based on the bootstrap standard error (i.e. mean(x) +/- qt(.975, df = length(x) - 1) * sd(x)), bounds of the confidence interval may be negative. Use method = "quantile" to make sure that the confidence intervals are always positive.

References

Levine TR, Hullett CR (2002): Eta Squared, Partial Eta Squared, and Misreporting of Effect Size in Communication Research (pdf)

Tippey K, Longnecker MT (2016): An Ad Hoc Method for Computing Pseudo-Effect Size for Mixed Model. (pdf)

Examples

Run this code
# NOT RUN {
# load sample data
data(efc)

# fit linear model
fit <- aov(
  c12hour ~ as.factor(e42dep) + as.factor(c172code) + c160age,
  data = efc
)

eta_sq(fit)
omega_sq(fit)
eta_sq(fit, partial = TRUE)
eta_sq(fit, partial = TRUE, ci.lvl = .8)

anova_stats(car::Anova(fit, type = 2))

# }

Run the code above in your browser using DataLab