Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

effectsize: Indices of Effect Size and Standardized Parameters, Study Guides, Projects, Research of Statistics for Psychologists

Effect size for ANOVA. Description. Functions to compute effect size measures for ANOVAs, such as Eta- (η), Omega- (ω) and Epsilon-.

Typology: Study Guides, Projects, Research

2021/2022

Uploaded on 09/27/2022

aaroncastle1
aaroncastle1 🇬🇧

4.3

(8)

223 documents

1 / 79

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Package ‘effectsize’
May 26, 2022
Type Package
Title Indices of Effect Size and Standardized Parameters
Version 0.7.0
Maintainer Mattan S. Ben-Shachar <matanshm@post.bgu.ac.il>
Description Provide utilities to work with indices of effect size and
standardized parameters for a wide variety of models (see list of
supported models using the function 'insight::supported_models()'),
allowing computation of and conversion between indices such as Cohen's
d, r, odds, etc.
License GPL-3
URL https://easystats.github.io/effectsize/
BugReports https://github.com/easystats/effectsize/issues/
Depends R (>= 3.4)
Imports bayestestR (>= 0.12.1), insight (>= 0.17.0), parameters (>=
0.18.0), performance (>= 0.9.0), datawizard (>= 0.4.1), stats,
utils
Suggests correlation (>= 0.8.0), see (>= 0.6.9), afex, BayesFactor,
biglm, boot, brms, car, covr, emmeans, gamm4, knitr, lavaan,
lm.beta, lme4, lmerTest, MASS, mediation, mgcv, pscl,
rmarkdown, rms, rstanarm, rstantools, spelling, testthat,
tidymodels
VignetteBuilder knitr
Encoding UTF-8
Language en-US
RoxygenNote 7.2.0
Config/testthat/edition 3
Config/testthat/parallel true
NeedsCompilation no
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f

Partial preview of the text

Download effectsize: Indices of Effect Size and Standardized Parameters and more Study Guides, Projects, Research Statistics for Psychologists in PDF only on Docsity!

Package ‘effectsize’

May 26, 2022

Type Package

Title Indices of Effect Size and Standardized Parameters

Version 0.7.

Maintainer Mattan S. Ben-Shachar matanshm@post.bgu.ac.il

Description Provide utilities to work with indices of effect size and standardized parameters for a wide variety of models (see list of supported models using the function 'insight::supported_models()'), allowing computation of and conversion between indices such as Cohen's d, r, odds, etc.

License GPL-

URL https://easystats.github.io/effectsize/

BugReports https://github.com/easystats/effectsize/issues/

Depends R (>= 3.4)

Imports bayestestR (>= 0.12.1), insight (>= 0.17.0), parameters (>= 0.18.0), performance (>= 0.9.0), datawizard (>= 0.4.1), stats, utils

Suggests correlation (>= 0.8.0), see (>= 0.6.9), afex, BayesFactor, biglm, boot, brms, car, covr, emmeans, gamm4, knitr, lavaan, lm.beta, lme4, lmerTest, MASS, mediation, mgcv, pscl, rmarkdown, rms, rstanarm, rstantools, spelling, testthat, tidymodels

VignetteBuilder knitr

Encoding UTF-

Language en-US

RoxygenNote 7.2.

Config/testthat/edition 3

Config/testthat/parallel true

NeedsCompilation no

2 R topics documented:

Author Mattan S. Ben-Shachar [aut, cre] (https://orcid.org/0000-0002-4287-4801, @mattansb), Dominique Makowski [aut] (https://orcid.org/0000-0001-5375-9967, @Dom_Makowski), Daniel Lüdecke [aut] (https://orcid.org/0000-0002-8895-3206, @strengejacke), Indrajeet Patil [aut] (https://orcid.org/0000-0003-1995-6531, @patilindrajeets), Brenton M. Wiernik [aut] (https://orcid.org/0000-0001-9560-6336, @bmwiernik), Ken Kelley [ctb], David Stanley [ctb], Jessica Burnett [rev] (https://orcid.org/0000-0002-0896-5099), Johannes Karreth [rev] (https://orcid.org/0000-0003-4586-7153)

Repository CRAN

Date/Publication 2022-05-26 13:20:02 UTC

R topics documented:

chisq_to_phi......................................... 3 cles............................................. 7 cohens_d.......................................... 9 d_to_cles.......................................... 13 d_to_r............................................ 15 effectsize.BFBayesFactor.................................. 16 effectsize_API........................................ 19 effectsize_CIs........................................ 20 effectsize_deprecated.................................... 23 equivalence_test.effectsize_table.............................. 24 eta2_to_f2.......................................... 26 eta_squared......................................... 27 format_standardize..................................... 33 F_to_eta2.......................................... 34 hardlyworking........................................ 38 interpret........................................... 38 interpret_bf......................................... 40 interpret_cohens_d..................................... 41 interpret_cohens_g..................................... 43 interpret_direction...................................... 44 interpret_ess......................................... 44 interpret_gfi......................................... 45 interpret_icc......................................... 48 interpret_kendalls_w.................................... 49 interpret_oddsratio..................................... 50 interpret_omega_squared.................................. 51 interpret_p.......................................... 52 interpret_pd......................................... 53

4 chisq_to_phi

chisq, n, nrow, ncol, ci = 0.95, alternative = "greater", adjust = FALSE, ... )

chisq_to_normalized( chisq, n, nrow, ncol, p, ci = 0.95, alternative = "greater", ... )

chisq_to_pearsons_c( chisq, n, nrow, ncol, ci = 0.95, alternative = "greater", ... )

phi_to_chisq(phi, n, ...)

Arguments

chisq The Chi-squared statistic. n Total sample size. nrow, ncol The number of rows/columns in the contingency table. ci Confidence Interval (CI) level alternative a character string specifying the alternative hypothesis; Controls the type of CI returned: "greater" (default) or "less" (one-sided CI), or "two.sided" (default, two-sided CI). Partial matching is allowed (e.g., "g", "l", "two"...). See One-Sided CIs in effectsize_CIs. adjust Should the effect size be bias-corrected? Defaults to FALSE. ... Arguments passed to or from other methods. p Vector of expected values. See stats::chisq.test(). phi The Phi statistic.

chisq_to_phi 5

Details

These functions use the following formulae:

φ =

χ^2 /n

Cramer′sV = φ/

min(nrow, ncol) − 1

P earson′sC =

χ^2 /(χ^2 + n)

χN ormalized = w ×

q 1 − q Where q is the smallest of the expected probabilities.

For adjusted versions of phi and V, see Bergsma, 2013.

Value

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

Confidence (Compatibility) Intervals (CIs)

Unless stated otherwise, confidence (compatibility) intervals (CIs) are estimated using the non- centrality parameter method (also called the "pivot method"). This method finds the noncentrality parameter ("ncp") of a noncentral t, F, or χ^2 distribution that places the observed t, F, or χ^2 test statistic at the desired probability point of the distribution. For example, if the observed t statistic is 2.0, with 50 degrees of freedom, for which cumulative noncentral t distribution is t = 2.0 the. quantile (answer: the noncentral t distribution with ncp = .04)? After estimating these confidence bounds on the ncp, they are converted into the effect size metric to obtain a confidence interval for the effect size (Steiger, 2004).

For additional details on estimation and troubleshooting, see effectsize_CIs.

CIs and Significance Tests

"Confidence intervals on measures of effect size convey all the information in a hypothesis test, and more." (Steiger, 2004). Confidence (compatibility) intervals and p values are complementary summaries of parameter uncertainty given the observed data. A dichotomous hypothesis test could be performed with either a CI or a p value. The 100 (1 - α)% confidence interval contains all of the parameter values for which p > α for the current data and model. For example, a 95% confidence interval contains all of the values for which p > .05.

Note that a confidence interval including 0 does not indicate that the null (no effect) is true. Rather, it suggests that the observed data together with the model and its assumptions combined do not pro- vided clear evidence against a parameter value of 0 (same as with any other value in the interval),

cles 7

7.8521, n = sum(Smoking_ASD), nrow = 1, ncol = 3, p = c(0.015, 0.010, 0.975) )

cles Estimate Common Language Effect Sizes (CLES)

Description

cohens_u3(), p_superiority(), and p_overlap() give only one of the CLESs.

Usage

cles( x, y = NULL, data = NULL, mu = 0, ci = 0.95, alternative = "two.sided", parametric = TRUE, verbose = TRUE, iterations = 200, ... )

common_language( x, y = NULL, data = NULL, mu = 0, ci = 0.95, alternative = "two.sided", parametric = TRUE, verbose = TRUE, iterations = 200, ... )

cohens_u3(...)

p_superiority(...)

p_overlap(...)

8 cles

Arguments

x A formula, a numeric vector, or a character name of one in data. y A numeric vector, a grouping (character / factor) vector, a or a character name of one in data. Ignored if x is a formula. data An optional data frame containing the variables. mu a number indicating the true value of the mean (or difference in means if you are performing a two sample test). ci Confidence Interval (CI) level alternative a character string specifying the alternative hypothesis; Controls the type of CI returned: "two.sided" (default, two-sided CI), "greater" or "less" (one- sided CI). Partial matching is allowed (e.g., "g", "l", "two"...). See One-Sided CIs in effectsize_CIs. parametric Use parametric estimation (see cohens_d()) or non-parametric estimation (see rank_biserial()). verbose Toggle warnings and messages on or off. iterations The number of bootstrap replicates for computing confidence intervals. Only applies when ci is not NULL and parametric = FALSE. ... Arguments passed to or from other methods. When x is a formula, these can be subset and na.action.

Details

These measures of effect size present group differences in probabilistic terms:

  • Probability of superiority is the probability that, when sampling an observation from each of the groups at random, that the observation from the second group will be larger than the sample from the first group.
  • Cohen’s U3 is the proportion of the second group that is smaller than the median of the first group.
  • Overlap (OVL) is the proportional overlap between the distributions. (When parametric = FALSE, bayestestR::overlap() is used.)

For unequal group sizes, it is recommended to use the non-parametric based CLES (parametric = FALSE).

Value

A data frame containing the common language effect sizes (and optionally their CIs).

Confidence Intervals (CIs)

For parametric CLES, the CIs are transformed CIs for Cohen’s d (d_to_cles()). For non-parametric (parametric = FALSE) CLES, the CI of Pr(superiority) is a transformed CI of the rank-biserial cor- relation (rb_to_cles()), while for Cohen’s U3 and the Overlap coefficient the confidence intervals are bootstrapped (requires the boot package).

10 cohens_d

Usage

cohens_d( x, y = NULL, data = NULL, pooled_sd = TRUE, mu = 0, paired = FALSE, ci = 0.95, alternative = "two.sided", verbose = TRUE, ... )

hedges_g( x, y = NULL, data = NULL, pooled_sd = TRUE, mu = 0, paired = FALSE, ci = 0.95, alternative = "two.sided", verbose = TRUE, ... )

glass_delta( x, y = NULL, data = NULL, mu = 0, ci = 0.95, alternative = "two.sided", verbose = TRUE, ... )

Arguments

x A formula, a numeric vector, or a character name of one in data. y A numeric vector, a grouping (character / factor) vector, a or a character name of one in data. Ignored if x is a formula. data An optional data frame containing the variables. pooled_sd If TRUE (default), a sd_pooled() is used (assuming equal variance). Else the mean SD from both groups is used instead.

cohens_d 11

mu a number indicating the true value of the mean (or difference in means if you are performing a two sample test). paired If TRUE, the values of x and y are considered as paired. This produces an effect size that is equivalent to the one-sample effect size on x - y. ci Confidence Interval (CI) level alternative a character string specifying the alternative hypothesis; Controls the type of CI returned: "two.sided" (default, two-sided CI), "greater" or "less" (one- sided CI). Partial matching is allowed (e.g., "g", "l", "two"...). See One-Sided CIs in effectsize_CIs. verbose Toggle warnings and messages on or off. ... Arguments passed to or from other methods. When x is a formula, these can be subset and na.action.

Details

Set pooled_sd = FALSE for effect sizes that are to accompany a Welch’s t-test (Delacre et al, 2021).

Value

A data frame with the effect size ( Cohens_d, Hedges_g, Glass_delta) and their CIs (CI_low and CI_high).

Confidence (Compatibility) Intervals (CIs)

Unless stated otherwise, confidence (compatibility) intervals (CIs) are estimated using the non- centrality parameter method (also called the "pivot method"). This method finds the noncentrality parameter ("ncp") of a noncentral t, F, or χ^2 distribution that places the observed t, F, or χ^2 test statistic at the desired probability point of the distribution. For example, if the observed t statistic is 2.0, with 50 degrees of freedom, for which cumulative noncentral t distribution is t = 2.0 the. quantile (answer: the noncentral t distribution with ncp = .04)? After estimating these confidence bounds on the ncp, they are converted into the effect size metric to obtain a confidence interval for the effect size (Steiger, 2004).

For additional details on estimation and troubleshooting, see effectsize_CIs.

CIs and Significance Tests

"Confidence intervals on measures of effect size convey all the information in a hypothesis test, and more." (Steiger, 2004). Confidence (compatibility) intervals and p values are complementary summaries of parameter uncertainty given the observed data. A dichotomous hypothesis test could be performed with either a CI or a p value. The 100 (1 - α)% confidence interval contains all of the parameter values for which p > α for the current data and model. For example, a 95% confidence interval contains all of the values for which p > .05.

Note that a confidence interval including 0 does not indicate that the null (no effect) is true. Rather, it suggests that the observed data together with the model and its assumptions combined do not pro- vided clear evidence against a parameter value of 0 (same as with any other value in the interval), with the level of this evidence defined by the chosen α level (Rafi & Greenland, 2020; Schweder

d_to_cles 13

cohens_d(wt ~ 1, data = mtcars)

same as:

cohens_d("wt", data = mtcars)

cohens_d(mtcars$wt)

More options:

cohens_d(wt ~ 1, data = mtcars, mu = 3) hedges_g(wt ~ 1, data = mtcars, mu = 3)

Paired Samples ----------

data(sleep)

cohens_d(Pair(extra[group == 1], extra[group == 2]) ~ 1, data = sleep)

same as:

cohens_d(sleep$extra[sleep$group == 1], sleep$extra[sleep$group == 2], paired = TRUE)

More options:

cohens_d(Pair(extra[group == 1], extra[group == 2]) ~ 1, data = sleep, mu = -1) hedges_g(Pair(extra[group == 1], extra[group == 2]) ~ 1, data = sleep)

Interpretation -----------------------

interpret_cohens_d(-1.48, rules = "cohen1988") interpret_hedges_g(-1.48, rules = "sawilowsky2009") interpret_glass_delta(-1.48, rules = "gignac2016")

Or:

interpret(d, rules = "sawilowsky2009")

Common Language Effect Sizes

d_to_cles(1.48)

Or:

print(d, append_CLES = TRUE)

d_to_cles Convert Standardized Mean Difference to Common Language Effect Sizes

Description

Convert Standardized Mean Difference to Common Language Effect Sizes

Usage

d_to_cles(d)

14 d_to_cles

rb_to_cles(rb)

Arguments

d, rb A numeric value of Cohen’s d / rank-biserial correlation or the output from cohens_d() / rank_biserial().

Details

This function use the following formulae for Cohen’s d:

P r(superiority) = Φ(d/

Cohen′sU 3 = Φ(d)

Overlap = 2 × Φ(−|d|/2)

And the following for the rank-biserial correlation:

P r(superiority) = (rrb + 1)/ 2

Value

A list of Cohen's U3, Overlap, Pr(superiority), a numeric vector of Pr(superiority), or a data frame, depending on the input.

Note

These calculations assume that the populations have equal variance and are normally distributed.

References

  • Cohen, J. (1977). Statistical power analysis for the behavioral sciences. New York: Routledge.
  • Reiser, B., & Faraggi, D. (1999). Confidence intervals for the overlapping coefficient: the normal equal variance case. Journal of the Royal Statistical Society, 48(3), 413-418.
  • Ruscio, J. (2008). A probability-based measure of effect size: robustness to base rates and other factors. Psychological methods, 13(1), 19–30.

See Also

cohens_d(), rank_biserial() Other convert between effect sizes: d_to_r(), eta2_to_f2(), odds_to_probs(), oddsratio_to_riskratio()

16 effectsize.BFBayesFactor

Value

Converted index.

References

  • Sánchez-Meca, J., Marín-Martínez, F., & Chacón-Moscoso, S. (2003). Effect-size indices for dichotomized outcomes in meta-analysis. Psychological methods, 8(4), 448.
  • Borenstein, M., Hedges, L. V., Higgins, J. P. T., & Rothstein, H. R. (2009). Converting among effect sizes. Introduction to meta-analysis, 45-49.
  • Rosenthal, R., & Rubin, D. B. (1982). A simple, general purpose display of magnitude of experimental effect. Journal of educational psychology, 74(2), 166.

See Also

Other convert between effect sizes: d_to_cles(), eta2_to_f2(), odds_to_probs(), oddsratio_to_riskratio()

Examples

r_to_d(0.5) d_to_oddsratio(1.154701) oddsratio_to_r(8.120534)

d_to_r(1) r_to_oddsratio(0.4472136, log = TRUE) oddsratio_to_d(1.813799, log = TRUE)

effectsize.BFBayesFactor Effect Size

Description

This function tries to return the best effect-size measure for the provided input model. See details.

Usage

S3 method for class 'BFBayesFactor'

effectsize(model, type = NULL, verbose = TRUE, test = NULL, ...)

effectsize(model, ...)

S3 method for class 'aov'

effectsize(model, type = NULL, ...)

S3 method for class 'htest'

effectsize(model, type = NULL, verbose = TRUE, ...)

effectsize.BFBayesFactor 17

Arguments

model An object of class htest, or a statistical model. See details. type The effect size of interest. See details. verbose Toggle warnings and messages on or off. test The indices of effect existence to compute. Character (vector) or list with one or more of these options: "p_direction" (or "pd"), "rope", "p_map", "equivalence_test" (or "equitest"), "bayesfactor" (or "bf") or "all" to compute all tests. For each "test", the corresponding bayestestR function is called (e.g. rope() or p_direction()) and its results included in the summary output. ... Arguments passed to or from other methods. See details.

Details

  • For an object of class htest, data is extracted via insight::get_data(), and passed to the relevant function according to: - A t-test depending on type: "cohens_d" (default), "hedges_g", or "cles". - A Chi-squared tests of independence, depending on type: "cramers_v" (default), "phi", "cohens_w", "pearsons_c", "cohens_h", "oddsratio", or "riskratio". - A Chi-squared tests of goodness-of-fit, depending on type: "normalized_chi" (de- fault) "cohens_w", "pearsons_c" - A One-way ANOVA test, depending on type: "eta" (default), "omega" or "epsilon" -squared, "f", or "f2". - A McNemar test returns Cohen’s g. - A Wilcoxon test depending on type: returns "rank_biserial" correlation (default) or "cles". - A Kruskal-Wallis test returns rank Epsilon squared. - A Friedman test returns Kendall’s W. (Where applicable, ci and alternative are taken from the htest if not otherwise provided.)
  • For an object of class BFBayesFactor, using bayestestR::describe_posterior(),
    • A t-test depending on type: "cohens_d"(default) or"cles"‘.
    • A correlation test returns r.
    • A contingency table test, depending on type: "cramers_v" (default), "phi", "cohens_w", "pearsons_c", "cohens_h", "oddsratio", or "riskratio".
    • A proportion test returns p.
  • Objects of class anova, aov, or aovlist, depending on type: "eta" (default), "omega" or "epsilon" -squared, "f", or "f2".
  • Other objects are passed to parameters::standardize_parameters(). For statistical models it is recommended to directly use the listed functions, for the full range of options they provide.

Value

A data frame with the effect size (depending on input) and and its CIs (CI_low and CI_high).

effectsize_API 19

effectsize(anova_table) effectsize(anova_table, type = "epsilon")

effectsize_API effectsize API

Description

Read the Support functions for model extensions vignette.

Usage

.es_aov_simple( aov_table, type = c("eta", "omega", "epsilon"), partial = TRUE, generalized = FALSE, ci = 0.95, alternative = "greater", verbose = TRUE, include_intercept = FALSE )

.es_aov_strata( aov_table, DV_names, type = c("eta", "omega", "epsilon"), partial = TRUE, generalized = FALSE, ci = 0.95, alternative = "greater", verbose = TRUE, include_intercept = FALSE )

.es_aov_table( aov_table, type = c("eta", "omega", "epsilon"), partial = TRUE, generalized = FALSE, ci = 0.95, alternative = "greater", verbose = TRUE, include_intercept = FALSE )

20 effectsize_CIs

Arguments

aov_table Input data frame type Which effect size to compute? partial, generalized, ci, alternative, verbose See eta_squared(). include_intercept Should the intercept ((Intercept)) be included? DV_names A character vector with the names of all the predictors, including the grouping variable (e.g., "Subject").

effectsize_CIs Confidence (Compatibility) Intervals

Description

More information regarding Confidence (Compatibiity) Intervals and how they are computed in effectsize.

Confidence (Compatibility) Intervals (CIs)

Unless stated otherwise, confidence (compatibility) intervals (CIs) are estimated using the non- centrality parameter method (also called the "pivot method"). This method finds the noncentrality parameter ("ncp") of a noncentral t, F, or χ^2 distribution that places the observed t, F, or χ^2 test statistic at the desired probability point of the distribution. For example, if the observed t statistic is 2.0, with 50 degrees of freedom, for which cumulative noncentral t distribution is t = 2.0 the. quantile (answer: the noncentral t distribution with ncp = .04)? After estimating these confidence bounds on the ncp, they are converted into the effect size metric to obtain a confidence interval for the effect size (Steiger, 2004).

For additional details on estimation and troubleshooting, see effectsize_CIs.

CIs and Significance Tests

"Confidence intervals on measures of effect size convey all the information in a hypothesis test, and more." (Steiger, 2004). Confidence (compatibility) intervals and p values are complementary summaries of parameter uncertainty given the observed data. A dichotomous hypothesis test could be performed with either a CI or a p value. The 100 (1 - α)% confidence interval contains all of the parameter values for which p > α for the current data and model. For example, a 95% confidence interval contains all of the values for which p > .05.

Note that a confidence interval including 0 does not indicate that the null (no effect) is true. Rather, it suggests that the observed data together with the model and its assumptions combined do not pro- vided clear evidence against a parameter value of 0 (same as with any other value in the interval), with the level of this evidence defined by the chosen α level (Rafi & Greenland, 2020; Schweder & Hjort, 2016; Xie & Singh, 2013). To infer no effect, additional judgments about what parameter values are "close enough" to 0 to be negligible are needed ("equivalence testing"; Bauer & Kiesser, 1996).