es_from_cohen_d {metaConvert} | R Documentation |
Convert a Cohen's d value to several effect size measures
Description
Convert a Cohen's d value to several effect size measures
Usage
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 |
reverse_d |
a logical value indicating whether the direction of generated effect sizes should be flipped. |
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 = \sqrt{\frac{n\_exp+n\_nexp}{n\_exp*n\_nexp} + \frac{cohen\_d^2}{2*(n\_exp+n\_nexp)}}
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\_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\_nexp - 2
J = exp(\log_{gamma}(\frac{df}{2}) - 0.5 * \log(\frac{df}{2}) - \log_{gamma}(\frac{df - 1}{2}))
hedges\_g = cohen\_d * J
hedges\_g\_se = \sqrt{cohen\_d\_se^2 * J^2}
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\_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 = \frac{cohen\_d * \pi}{\sqrt{3}}
logor\_se = \sqrt{\frac{cohen\_d\_se^2 * \pi^2}{3}}
logor\_lo = logor - logor\_se * qnorm(.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 = \frac{n\_exp + n\_nexp}{n\_exp} + \frac{n\_exp + n\_nexp}{n\_nexp}
r.pb = \frac{cohen\_d}{\sqrt{cohen\_d^2 + h}}
p = \frac{n\_exp}{n\_exp + n\_nexp}
q = 1 - p
R = \frac{\sqrt{p*q}}{dnorm(qnorm(1-p)) * r.pb}
R\_var = \frac{1}{n\_exp + n\_nexp - 1} * (\frac{\sqrt{p*q}}{dnorm(qnorm(1-p))} - R^2)^2
R\_se = \sqrt{R\_var}
a = \frac{\sqrt{dnorm(qnorm(1-p))}}{(p*q)^\frac{1}{4}}
Z = \frac{a}{2} * \log(\frac{1+a*R}{1-a*R})
Z\_var = \frac{1}{n - 1}
Z\_se = \sqrt{Z\_var}
Z\_ci\_lo = Z - qnorm(.975) * Z\_se
Z\_ci\_up = Z + qnorm(.975) * Z\_se
R\_ci\_lo = tanh(Z\_lo)
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 = \frac{n\_exp}{n\_exp + n\_nexp}
R = \frac{cohen\_d}{\sqrt{cohen\_d^2 + 1 / (p * (1 - p))}}
a = \frac{(n\_exp + n\_nexp)^2}{(n\_exp*n\_nexp)}
var\_R = \frac{a^2 * cohen\_d\_se^2}{(cohen\_d^2 + a)^3}
R\_se = \sqrt{R\_var}
R\_ci\_lo = R - qt(.975, n\_exp+n\_nexp- 2) * R\_se
R\_ci\_up = R + qt(.975, n\_exp+n\_nexp- 2) * R\_se
Z = atanh(R)
Z\_var = \frac{cohen\_d\_se^2}{cohen\_d\_se^2 + (1 / p*(1-p))}
Z\_se = \sqrt{Z\_var}
Z\_ci\_lo = Z - qnorm(.975) * Z\_se
Z\_ci\_up = Z + qnorm(.975) * Z\_se
Value
This function estimates and converts between several effect size measures.
natural effect size measure | D + G |
converted effect size measure | OR + R + Z |
required input data | See 'Section 1. Cohen's d or Hedges' g' |
https://metaconvert.org/html/input.html | |
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.
Examples
es_from_cohen_d(cohen_d = 1, n_exp = 20, n_nexp = 20)