r_to_d {MetaUtility} | R Documentation |
Convert Pearson's r to Cohen's d
Description
Converts Pearson's r (computed with a continuous X and Y) to Cohen's d for use in meta-analysis. The resulting Cohen's d represents the estimated increase in standardized Y that is associated with a delta-unit increase in X.
Usage
r_to_d(r, sx, delta, N = NA, Ns = N, sx.known = FALSE)
Arguments
r |
Pearson's correlation |
sx |
Sample standard deviation of X |
delta |
Contrast in X for which to compute Cohen's d, specified in raw units of X (not standard deviations). |
N |
Sample size used to estimate |
Ns |
Sample size used to estimate |
sx.known |
Is |
Details
To preserve the sign of the effect size, the code takes the absolute value of delta
. The standard error
estimate assumes that X is approximately normal and that N
is large.
References
Mathur MB & VanderWeele TJ (2019). A simple, interpretable conversion from Pearson's correlation to Cohen's d for meta-analysis. Epidemiology.
Examples
# d for a 1-unit vs. a 2-unit increase in X
r_to_d( r = 0.5,
sx = 2,
delta = 1,
N = 100 )
r_to_d( r = 0.5,
sx = 2,
delta = 2,
N = 100 )
# d when sx is estimated in the same vs. a smaller sample
# point estimate will be the same, but inference will be a little
# less precise in second case
r_to_d( r = -0.3,
sx = 2,
delta = 2,
N = 300,
Ns = 300 )
r_to_d( r = -0.3,
sx = 2,
delta = 2,
N = 300,
Ns = 30 )