es_from_cohen_d function

Convert a Cohen's d value to several effect size measures

Convert a Cohen's d value to several effect size measures

es_from_cohen_d(cohen_d, n_exp, n_nexp, smd_to_cor = "viechtbauer", reverse_d)

Arguments

  • cohen_d: Cohen's d (i.e., standardized mean difference) value.
  • n_exp: number of participants in the experimental/exposed group.
  • n_nexp: number of participants in the non-experimental/non-exposed group.
  • smd_to_cor: formula used to convert the cohen_d value into a coefficient correlation (see details).
  • reverse_d: a logical value indicating whether the direction of generated effect sizes should be flipped.

Returns

This function estimates and converts between several effect size measures.

natural effect size measureD + G
converted effect size measureOR + R + Z
required input dataSee 'Section 1. Cohen's d or Hedges' g'
https://metaconvert.org/input.html

Details

This function estimates the standard error of a Cohen's d value and computes a Hedges' g (G). Odds ratio (OR) and correlation coefficients (R/Z) are then converted from the Cohen's d.

To estimate the standard error of Cohen's d , the following formula is used (formula 12.13 in Cooper):

cohen_d_se=n_exp+n_nexpn_expn_nexp+cohen_d22(n_exp+n_nexp) cohen\_d\_se = \sqrt{\frac{n\_exp+n\_nexp}{n\_exp*n\_nexp} + \frac{cohen\_d^2}{2*(n\_exp+n\_nexp)}} cohen_d_ci_lo=cohen_dcohen_d_seqt(.975,df=n_exp+n_nexp2) cohen\_d\_ci\_lo = cohen\_d - cohen\_d\_se * qt(.975, df = n\_exp+n\_nexp-2) cohen_d_ci_up=cohen_d+cohen_d_seqt(.975,df=n_exp+n_nexp2) cohen\_d\_ci\_up = cohen\_d + cohen\_d\_se * qt(.975, df = n\_exp+n\_nexp-2)

To estimate the Hedges' g and its standard error , the following formulas are used (Hedges, 1981):

df=n_exp+n_nexp2 df = n\_exp + n\_nexp - 2 J=exp(loggamma(df2)0.5log(df2)loggamma(df12)) J = exp(\log_{gamma}(\frac{df}{2}) - 0.5 * \log(\frac{df}{2}) - \log_{gamma}(\frac{df - 1}{2})) hedges_g=cohen_dJ hedges\_g = cohen\_d * J hedges_g_se=cohen_d_se2J2 hedges\_g\_se = \sqrt{cohen\_d\_se^2 * J^2} hedges_g_ci_lo=hedges_ghedges_g_seqt(.975,df=n_exp+n_nexp2) hedges\_g\_ci\_lo = hedges\_g - hedges\_g\_se * qt(.975, df = n\_exp+n\_nexp-2) hedges_g_ci_up=hedges_g+hedges_g_seqt(.975,df=n_exp+n_nexp2) hedges\_g\_ci\_up = hedges\_g + hedges\_g\_se * qt(.975, df = n\_exp+n\_nexp-2)

To estimate the log odds ratio and its standard error , the following formulas are used (formulas 12.34-12.35 in Cooper):

logor=cohen_dπ3 logor = \frac{cohen\_d * \pi}{\sqrt{3}} logor_se=cohen_d_se2π23 logor\_se = \sqrt{\frac{cohen\_d\_se^2 * \pi^2}{3}} logor_lo=logorlogor_seqnorm(.975) logor\_lo = logor - logor\_se * qnorm(.975) logor_up=logor+logor_seqnorm(.975) logor\_up = logor + logor\_se * qnorm(.975)

Note that this conversion assumes that responses within the two groups follow logistic distributions.

To estimate the correlation coefficient and its standard error , various formulas can be used.

A. To estimate the 'biserial' correlation (smd_to_cor="viechtbauer"), the following formulas are used (formulas 5, 8, 13, 17, 18, 19 in Viechtbauer):

h=n_exp+n_nexpn_exp+n_exp+n_nexpn_nexp h = \frac{n\_exp + n\_nexp}{n\_exp} + \frac{n\_exp + n\_nexp}{n\_nexp} r.pb=cohen_dcohen_d2+h r.pb = \frac{cohen\_d}{\sqrt{cohen\_d^2 + h}} p=n_expn_exp+n_nexp p = \frac{n\_exp}{n\_exp + n\_nexp} q=1p q = 1 - p R=pqdnorm(qnorm(1p))r.pb R = \frac{\sqrt{p*q}}{dnorm(qnorm(1-p)) * r.pb} R_var=1n_exp+n_nexp1(pqdnorm(qnorm(1p))R2)2 R\_var = \frac{1}{n\_exp + n\_nexp - 1} * (\frac{\sqrt{p*q}}{dnorm(qnorm(1-p))} - R^2)^2 R_se=R_var R\_se = \sqrt{R\_var} a=dnorm(qnorm(1p))(pq)14 a = \frac{\sqrt{dnorm(qnorm(1-p))}}{(p*q)^\frac{1}{4}} Z=a2log(1+aR1aR) Z = \frac{a}{2} * \log(\frac{1+a*R}{1-a*R}) Z_var=1n1 Z\_var = \frac{1}{n - 1} Z_se=Z_var Z\_se = \sqrt{Z\_var} Z_ci_lo=Zqnorm(.975)Z_se Z\_ci\_lo = Z - qnorm(.975) * Z\_se Z_ci_up=Z+qnorm(.975)Z_se Z\_ci\_up = Z + qnorm(.975) * Z\_se R_ci_lo=tanh(Z_lo) R\_ci\_lo = tanh(Z\_lo) R_ci_up=tanh(Z_up) R\_ci\_up = tanh(Z\_up)

B. To estimate the correlation coefficient according to Cooper et al. (2019) (formulas 12.40-42) and Borenstein et al. (2009) (formulas 54-56), the following formulas are used (smd_to_cor="lipsey_cooper"):

p=n_expn_exp+n_nexp p = \frac{n\_exp}{n\_exp + n\_nexp} R=cohen_dcohen_d2+1/(p(1p)) R = \frac{cohen\_d}{\sqrt{cohen\_d^2 + 1 / (p * (1 - p))}} a=(n_exp+n_nexp)2(n_expn_nexp) a = \frac{(n\_exp + n\_nexp)^2}{(n\_exp*n\_nexp)} var_R=a2cohen_d_se2(cohen_d2+a)3 var\_R = \frac{a^2 * cohen\_d\_se^2}{(cohen\_d^2 + a)^3} R_se=R_var R\_se = \sqrt{R\_var} R_ci_lo=Rqt(.975,n_exp+n_nexp2)R_se R\_ci\_lo = R - qt(.975, n\_exp+n\_nexp- 2) * R\_se R_ci_up=R+qt(.975,n_exp+n_nexp2)R_se R\_ci\_up = R + qt(.975, n\_exp+n\_nexp- 2) * R\_se Z=atanh(R) Z = atanh(R) Z_var=cohen_d_se2cohen_d_se2+(1/p(1p)) Z\_var = \frac{cohen\_d\_se^2}{cohen\_d\_se^2 + (1 / p*(1-p))} Z_se=Z_var Z\_se = \sqrt{Z\_var} Z_ci_lo=Zqnorm(.975)Z_se Z\_ci\_lo = Z - qnorm(.975) * Z\_se Z_ci_up=Z+qnorm(.975)Z_se Z\_ci\_up = Z + qnorm(.975) * Z\_se

Examples

es_from_cohen_d(cohen_d = 1, n_exp = 20, n_nexp = 20)

References

Cooper, H., Hedges, L.V., & Valentine, J.C. (Eds.). (2019). The handbook of research synthesis and meta-analysis. Russell Sage Foundation.

Borenstein, M., Hedges, L. V., Higgins, J. P., & Rothstein, H. R. (2021). Introduction to meta-analysis. John Wiley & Sons.

Hedges LV (1981): Distribution theory for Glass’s estimator of effect size and related estimators. Journal of Educational and Behavioral Statistics, 6, 107–28

Jacobs, P., & Viechtbauer, W. (2017). Estimation of the biserial correlation and its sampling variance for use in meta-analysis. Research synthesis methods, 8(2), 161–180.

  • Maintainer: Corentin J. Gosling
  • License: GPL (>= 3)
  • Last published: 2024-11-17

Useful links