Learn R Programming

effectsize (version 0.2.0)

F_to_eta2: Convert test statistics (F, t) to indices of partial variance explained (partial Eta / Omega / Epsilon squared)

Description

These functions are convenience functions to convert F and t test statistics to partial Eta squared, (\(\eta{_p}^2\)), Omega squared (\(\omega{_p}^2\)) and Epsilon squared (\(\epsilon{_p}^2\); an alias for the adjusted Eta squared). These are useful in cases where the various Sum of Squares and Mean Squares are not easily available or their computation is not straightforward (e.g., in liner mixed models, contrasts, etc.). For test statistics derived from lm and aov models, these functions give exact results. For all other cases, they return close approximations.

Usage

F_to_eta2(f, df, df_error, ...)

t_to_eta2(t, df_error, ...)

F_to_epsilon2(f, df, df_error, ...)

t_to_epsilon2(t, df_error, ...)

F_to_eta2_adj(f, df, df_error, ...)

t_to_eta2_adj(t, df_error, ...)

F_to_omega2(f, df, df_error, ...)

t_to_omega2(t, df_error, ...)

Arguments

df, df_error

Degrees of freedom of numerator or of the error estimate (i.e., the residuals).

...

Arguments passed to or from other methods.

t, f

The t or the F statistics.

Value

A numeric value between 0-1 (Note that for \(\omega_p^2\) and \(\epsilon_p^2\) it is possible to compute a negative number; even though this doesn't make any practical sense, it is recommended to report the negative number and not a 0).

Details

These functions use the following formulae:

$$\eta_p^2 = \frac{F \times df_{num}}{F \times df_{num} + df_{den}}$$

$$\epsilon_p^2 = \frac{(F - 1) \times df_{num}}{F \times df_{num} + df_{den}}$$

$$\omega_p^2 = \frac{(F - 1) \times df_{num}}{F \times df_{num} + df_{den} + 1}$$

For \(t\), the conversion is based on the equality of \(t^2 = F\) when \(df_{num}=1\).

References

  • Friedman, H. (1982). Simplified determinations of statistical power, magnitude of effect and research sample sizes. Educational and Psychological Measurement, 42(2), 521-526. 10.1177/001316448204200214

  • Mordkoff, J. T. (2019). A Simple Method for Removing Bias From a Popular Measure of Standardized Effect Size: Adjusted Partial Eta Squared. Advances in Methods and Practices in Psychological Science, 2(3), 228-232. 10.1177/2515245919855053

  • 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. 10.31234/osf.io/b7z4q

Examples

Run this code
# NOT RUN {
if (require("afex")) {
  data(md_12.1)
  aov_ez("id", "rt", md_12.1,
    within = c("angle", "noise"),
    anova_table = list(correction = "none", es = "pes")
  )
}
# compare to:
F_to_eta2(40.72, 2, 18)
F_to_eta2(33.77, 1, 9)
F_to_eta2(45.31, 2, 18)


if (require("lmerTest")) { # for the df_error
  fit <- lmer(extra ~ group + (1 | ID), sleep)
  anova(fit)
  # Type III Analysis of Variance Table with Satterthwaite's method
  #       Sum Sq Mean Sq NumDF DenDF F value   Pr(>F)
  # group 12.482  12.482     1     9  16.501 0.002833 **
  # ---
  # Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  F_to_eta2(16.501, 1, 9)
  F_to_omega2(16.501, 1, 9)
  F_to_epsilon2(16.501, 1, 9)
}
# }

Run the code above in your browser using DataLab