15  Converting to Cohen’s d

15.1 From Independent Samples t-statistic

To calculate a between subject standardized mean difference (dp, i.e., pooled standard deviation standardizer), we can use the sample size in each group (n1 and n2) as well as the t-statistic from an independent sample t-test and plug it into the following formula:

(15.1)dp=t1n1+1n2

Using the t_to_d function in the effectsize package we can convert t to dp.

# Example:
# unpaired t-statistic = 3.25
# n1 = 50, n2 = 40

library(effectsize)

t <- 3.25
n1 <- 50
n2 <- 40

t_to_d(t, df_error = n1+n2-2, paired = FALSE)
d    |       95% CI
-------------------
0.69 | [0.26, 1.12]

15.2 From Paired Sample t-statistic

To calculate a within-subject standardized mean difference (dz, i.e., difference score standardizer), we can use the sample size in each group (n1 and n2) as well as the t-statistic from an paired sample t-test and plug it into the following formula:

(15.2)dz=tn

Using the t_to_d function in the effectsize package we can convert t to dz.

# Example:
# paired t-statistic = 3.25
# n = 50

t <- 3.25
n <- 50

t_to_d(t, df_error = n-1, paired = TRUE)
d    |       95% CI
-------------------
0.46 | [0.17, 0.76]

15.3 From Pearson Correlation

If a Pearson correlation is calculated between a continuous score and a dichotomous score, this is considered a point-biserial correlation. The point-biserial correlation can be converted into a dp value using the following formula:

(15.3)dp=r1r2n1+n22n1+n1+n22n2 Or if sample sizes within each group are unknown (or equal), the equation simplifies to be approximately,

(15.4)dpr41r2

Using the r_to_d function in the effectsize package we can convert r to dp.

# Example:
# r = 3.25
# n1 = 50, n2 = 40

r <- .50
n1 <- 50
n2 <- 40

r_to_d(r = r, n1 = n1, n2 = n2)
[1] 1.148913

15.4 From Odds-Ratio

An odds-ratio from a contingency table can also be converted to a dp. Note that this formula is an approximation:

(15.5)dp=log(OR)3π

Using the oddsratio_to_d function in the effectsize package we can convert OR to dp.

# Example:
# OR = 1.46

OR <- 1.46

oddsratio_to_d(OR = OR)
[1] 0.2086429