View source: R/es_from_stand_COR.R
es_from_pearson_r | R Documentation |
Convert a Pearson's correlation coefficient to several effect size measures
es_from_pearson_r(
pearson_r,
sd_iv,
n_sample,
n_exp,
n_nexp,
cor_to_smd = "viechtbauer",
unit_increase_iv,
unit_type = "raw_scale",
reverse_pearson_r
)
pearson_r |
a Pearson's correlation coefficient value |
sd_iv |
the standard deviation of the independent variable |
n_sample |
the total number of participants |
n_exp |
number of the experimental/exposed group |
n_nexp |
number of the non-experimental/non-exposed group |
cor_to_smd |
formula used to convert a |
unit_increase_iv |
a value of the independent variable that will be used to estimate the Cohen's d (see details). |
unit_type |
the type of unit for the |
reverse_pearson_r |
a logical value indicating whether the direction of the generated effect sizes should be flipped. |
This function estimates the variance of a Pearson's correlation coefficient, and computes the Fisher's r-to-z transformation. Cohen's d (D), Hedges' g (G) are converted from the Pearson's r, and odds ratio (OR) are converted from the Cohen's d.
The formula used to estimate the standard error of the Pearson's correlation coefficient and 95% CI are (Formula 12.27 in Cooper):
R\_se = \sqrt{\frac{(1 - pearson\_r^2)^2}{n\_sample - 1}}
R\_lo = pearson\_r - qt(.975, n\_sample - 2) * R\_se
R\_up = pearson\_r + qt(.975, n\_sample - 2) * R\_se
The formula used to estimate the Fisher's z are (Formula 12.28 & 12.29 in Cooper):
Z = atanh(r)
Z\_se = \frac{1}{n\_sample - 3}
Z\_ci\_lo = Z - qnorm(.975) * Z\_se
Z\_ci\_up = Z + qnorm(.975) * Z\_se
Several approaches can be used to convert a correlation coefficient to a SMD.
A. Mathur proposes to use this formula (Formula 1.2 in Mathur, cor_to_smd = "mathur"
):
increase = ifelse(unit_type == "sd", unit\_increase\_iv * sd\_dv, unit\_increase\_iv)
d = \frac{r * increase}{sd_iv * \sqrt{1 - r^2}}
d\_se = abs(d) * \sqrt{\frac{1}{r^2 * (n\_sample - 3)} + \frac{1}{2*(n\_sample - 1))}}
The resulting Cohen's d is the average increase in the dependent variable associated with an increase of x units in the independent variable (with x = unit_increase_iv
).
B. Viechtbauer proposes to use the delta method to derive a Cohen's d from a correlation coefficient (Viechtbauer, 2023, cor_to_smd = "viechtbauer"
)
C. Cooper proposes to use this formula (Formula 12.38 & 12.39 in Cooper, cor_to_smd = cooper
):
increase = ifelse(unit_type == "sd", unit\_increase\_iv * sd\_dv, unit\_increase\_iv)
d = \frac{r * increase}{sd\_iv * \sqrt{1 - r^2}}
d\_se = abs(d) * \sqrt{\frac{1}{r^2 * (n\_sample - 3)} + \frac{1}{2*(n\_sample - 1))}}
Note that this formula was initially proposed for converting a point-biserial correlation to
Cohen's d. It will thus produce similar results to the cor_to_smd = "mathur"
option
only when unit_type = "sd"
and unit_increase_iv = 2
.
To know how the Cohen's d value is converted to other effect measures (G/OR), see details of the es_from_cohen_d
function.
This function estimates and converts between several effect size measures.
natural effect size measure | R + Z |
converted effect size measure | D + G + OR |
required input data | See 'Section 4. Pearson's r or Fisher's z' |
https://metaconvert.org/input.html | |
Cooper, H., Hedges, L.V., & Valentine, J.C. (Eds.). (2019). The handbook of research synthesis and meta-analysis. Russell Sage Foundation.
Mathur, M. B., & VanderWeele, T. J. (2020). A Simple, Interpretable Conversion from Pearson's Correlation to Cohen's for d Continuous Exposures. Epidemiology (Cambridge, Mass.), 31(2), e16–e18. https://doi.org/10.1097/EDE.0000000000001105
Viechtbauer W (2010). “Conducting meta-analyses in R with the metafor package.” Journal of Statistical Software, 36(3), 1–48. doi:10.18637/jss.v036.i03.
es_from_pearson_r(
pearson_r = .51, sd_iv = 0.24, n_sample = 214,
unit_increase_iv = 1, unit_type = "sd"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.