Learn R Programming

effectsize: Indices of Effect Size

Significant is just not enough!

The goal of this package is to provide utilities to work with indices of effect size and standardized parameters, allowing computation and conversion of indices such as Cohen’s d, r, odds-ratios, etc.

Installation

Run the following to install the stable release of effectsize from CRAN:

install.packages("effectsize")

Or you can install the latest development version from R-universe:

install.packages("effectsize", repos = "https://easystats.r-universe.dev/")

Documentation

Click on the buttons above to access the package documentation and the easystats blog, and check-out these vignettes:

Features

This package is focused on indices of effect size. Check out the package website for a full list of features and functions provided by effectsize.

library(effectsize)
options(es.use_symbols = TRUE) # get nice symbols when printing! (On Windows, requires R >= 4.2.0)

Tip:

Instead of library(effectsize), use library(easystats). This will make all features of the easystats-ecosystem available.

To stay updated, use easystats::install_latest().

Effect Size Computation

The package provides functions to compute indices of effect size.

Standardized Differences (Cohen’s d, Hedges’ g, Glass’ delta)

cohens_d(mpg ~ am, data = mtcars)
## Cohen's d |         95% CI
## --------------------------
## -1.48     | [-2.27, -0.67]
## 
## - Estimated using pooled SD.

hedges_g(mpg ~ am, data = mtcars)
## Hedges' g |         95% CI
## --------------------------
## -1.44     | [-2.21, -0.65]
## 
## - Estimated using pooled SD.

glass_delta(mpg ~ am, data = mtcars)
## Glass' Δ (adj.) |         95% CI
## --------------------------------
## -1.10           | [-1.80, -0.37]

effectsize also provides effect sizes for paired standardized differences, rank tests, common language effect sizes and more…

Contingency Tables

# Dependence
phi(mtcars$am, mtcars$vs)
## ϕ (adj.) |       95% CI
## -----------------------
## 0.00     | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].

cramers_v(mtcars$am, mtcars$cyl)
## Cramer's V (adj.) |       95% CI
## --------------------------------
## 0.46              | [0.00, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].

# Goodness-of-fit
fei(table(mtcars$cyl), p = c(0.1, 0.3, 0.6))
## פ‎    |       95% CI
## -------------------
## 0.27 | [0.17, 1.00]
## 
## - Adjusted for uniform expected probabilities.
## - One-sided CIs: upper bound fixed at [1.00].

ANOVAs (Eta2, Omega2, …)

model <- aov(mpg ~ factor(gear), data = mtcars)

eta_squared(model)
## # Effect Size for ANOVA
## 
## Parameter    |   η² |       95% CI
## ----------------------------------
## factor(gear) | 0.43 | [0.18, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].

omega_squared(model)
## # Effect Size for ANOVA
## 
## Parameter    |   ω² |       95% CI
## ----------------------------------
## factor(gear) | 0.38 | [0.14, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].

epsilon_squared(model)
## # Effect Size for ANOVA
## 
## Parameter    |   ε² |       95% CI
## ----------------------------------
## factor(gear) | 0.39 | [0.14, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].

And more…

Effect Size Conversion

The package also provides ways of converting between different effect sizes.

d_to_r(d = 0.2)
## [1] 0.0995

oddsratio_to_riskratio(2.6, p0 = 0.4)
## [1] 1.59

And for recovering effect sizes from test statistics.

F_to_d(15, df = 1, df_error = 60)
## d    |       95% CI
## -------------------
## 1.00 | [0.46, 1.53]

F_to_r(15, df = 1, df_error = 60)
## r    |       95% CI
## -------------------
## 0.45 | [0.22, 0.61]

F_to_eta2(15, df = 1, df_error = 60)
## η² (partial) |       95% CI
## ---------------------------
## 0.20         | [0.07, 1.00]
## 
## - One-sided CIs: upper bound fixed at [1.00].

Effect Size Interpretation

The package allows for an automated interpretation of different indices.

interpret_r(r = 0.3)
## [1] "large"
## (Rules: funder2019)

Different sets of “rules of thumb” are implemented (guidelines are detailed here) and can be easily changed.

interpret_cohens_d(d = 0.45, rules = "cohen1988")
## [1] "small"
## (Rules: cohen1988)

interpret_cohens_d(d = 0.45, rules = "gignac2016")
## [1] "moderate"
## (Rules: gignac2016)

Citation

In order to cite this package, please use the following citation:

  • Ben-Shachar M, Lüdecke D, Makowski D (2020). effectsize: Estimation of Effect Size Indices and Standardized Parameters. Journal of Open Source Software, 5(56), 2815. doi: 10.21105/joss.02815

Corresponding BibTeX entry:

@Article{,
  title = {{e}ffectsize: Estimation of Effect Size Indices and Standardized Parameters},
  author = {Mattan S. Ben-Shachar and Daniel Lüdecke and Dominique Makowski},
  year = {2020},
  journal = {Journal of Open Source Software},
  volume = {5},
  number = {56},
  pages = {2815},
  publisher = {The Open Journal},
  doi = {10.21105/joss.02815},
  url = {https://doi.org/10.21105/joss.02815}
}

Contributing and Support

If you have any questions regarding the the functionality of the package, you may either contact us via email or also file an issue. Anyone wishing to contribute to the package by adding functions, features, or in another way, please follow this guide and our code of conduct.

Copy Link

Version

Install

install.packages('effectsize')

Monthly Downloads

59,962

Version

1.0.0

License

MIT + file LICENSE

Maintainer

Mattan S. Ben-Shachar

Last Published

December 10th, 2024

Functions in effectsize (1.0.0)

equivalence_test.effectsize_table

Test Effect Size for Practical Equivalence to the Null
eta2_to_f2

Convert Between ANOVA Effect Sizes
effectsize-package

effectsize: Indices of Effect Size
effectsize_API

effectsize API
effectsize_deprecated

Deprecated / Defunct Functions
effectsize_CIs

Confidence (Compatibility) Intervals
effectsize_options

effectsize options
eta_squared

\(\eta^2\) and Other Effect Size for ANOVA
food_class

Classification of Foods
effectsize.BFBayesFactor

Effect Sizes
interpret_direction

Interpret Direction
format_standardize

Format a Standardized Vector
interpret

Generic Function for Interpretation
interpret_gfi

Interpret of CFA / SEM Indices of Goodness of Fit
interpret_ess

Interpret Bayesian Diagnostic Indices
interpret_bf

Interpret Bayes Factor (BF)
hardlyworking

Workers' Salary and Other Information
is_effectsize_name

Checks for a Valid Effect Size Name
interpret_cohens_g

Interpret Cohen's g
interpret_cohens_d

Interpret Standardized Differences
interpret_icc

Interpret Intraclass Correlation Coefficient (ICC)
interpret_kendalls_w

Interpret Kendall's Coefficient of Concordance W
interpret_vif

Interpret the Variance Inflation Factor (VIF)
interpret_r2

Interpret Coefficient of Determination (\(R^2\))
interpret_omega_squared

Interpret ANOVA Effect Sizes
interpret_p

Interpret p-Values
interpret_oddsratio

Interpret Odds Ratio
interpret_pd

Interpret Probability of Direction (pd)
interpret_r

Interpret Correlation Coefficient
mahalanobis_d

Mahalanobis' D (a multivariate Cohen's d)
means_ratio

Ratio of Means
r2_semipartial

Semi-Partial (Part) Correlation Squared (\(\Delta R^2\))
rank_biserial

Dominance Effect Sizes for Rank Based Differences
p_superiority

Cohen's Us and Other Common Language Effect Sizes (CLES)
oddsratio_to_riskratio

Convert Between Odds Ratios, Risk Ratios and Other Metrics of Change in Probabilities
interpret_rope

Interpret Bayesian Posterior Percentage in ROPE.
phi

\(\phi\) and Other Contingency Tables Correlations
plot.effectsize_table

Methods for {effectsize} Tables
rank_epsilon_squared

Effect Size for Rank Based ANOVA
w_to_fei

Convert Between Effect Sizes for Contingency Tables Correlations
reexports

Objects exported from other packages
oddsratio

Odds Ratios, Risk Ratios and Other Effect Sizes for 2-by-2 Contingency Tables
odds_to_probs

Convert Between Odds and Probabilities
sd_pooled

Pooled Indices of (Co)Deviation
t_to_d

Convert t, z, and F to Cohen's d or partial-r
repeated_measures_d

Standardized Mean Differences for Repeated Measures
rouder2016

Jeff Rouder's Example Dataset for Repeated Measures
rules

Create an Interpretation Grid
screening_test

Results from 2 Screening Tests
RCT_table

Fictional Results from a Workers' Randomized Control Trial
chisq_to_phi

Convert \(\chi^2\) to \(\phi\) and Other Correlation-like Effect Sizes
cohens_d

Cohen's d and Other Standardized Differences
cohens_g

Effect Size for Paired Contingency Tables
diff_to_cles

Convert Standardized Differences to Common Language Effect Sizes
d_to_r

Convert Between d, r, and Odds Ratio
F_to_eta2

Convert F and t Statistics to partial-\(\eta^2\) and Other ANOVA Effect Sizes
Smoking_FASD

Frequency of FASD for Smoking Mothers
Music_preferences

Music Preference by College Major
Music_preferences2

Music Preference by College Major