```
# Example:
# unpaired t-statistic = 3.25
# n1 = 50, n2 = 40
library(effectsize)
<- 3.25
t <- 50
n1 <- 40
n2
t_to_d(t, df_error = n1+n2-2, paired = FALSE)
```

```
d | 95% CI
-------------------
0.69 | [0.26, 1.12]
```

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

\[ d_{p} = t\sqrt{\frac{1}{n_1}+\frac{1}{n_2} } \tag{15.1}\]

Using the `t_to_d`

function in the `effectsize`

package we can convert \(t\) to \(d_p\).

```
# Example:
# unpaired t-statistic = 3.25
# n1 = 50, n2 = 40
library(effectsize)
<- 3.25
t <- 50
n1 <- 40
n2
t_to_d(t, df_error = n1+n2-2, paired = FALSE)
```

```
d | 95% CI
-------------------
0.69 | [0.26, 1.12]
```

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

\[ d_{z} = \frac{t}{\sqrt{n}} \tag{15.2}\]

Using the `t_to_d`

function in the `effectsize`

package we can convert \(t\) to \(d_z\).

```
# Example:
# paired t-statistic = 3.25
# n = 50
<- 3.25
t <- 50
n
t_to_d(t, df_error = n-1, paired = TRUE)
```

```
d | 95% CI
-------------------
0.46 | [0.17, 0.76]
```

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 \(d_p\) value using the following formula:

\[ d_p = \frac{r}{\sqrt{1-r^2}} \sqrt{\frac{n_1+n_2-2}{n_1} + \frac{n_1+n_2-2}{n_2}} \tag{15.3}\] Or if sample sizes within each group are unknown (or equal), the equation simplifies to be approximately,

\[ d_p \approx \frac{r\sqrt{4}}{\sqrt{1-r^2}} \tag{15.4}\]

Using the `r_to_d`

function in the `effectsize`

package we can convert \(r\) to \(d_p\).

```
# Example:
# r = 3.25
# n1 = 50, n2 = 40
<- .50
r <- 50
n1 <- 40
n2
r_to_d(r = r, n1 = n1, n2 = n2)
```

`[1] 1.148913`

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

\[ d_{p} = \frac{\log(OR)\sqrt{3}}{\pi} \tag{15.5}\]

Using the `oddsratio_to_d`

function in the `effectsize`

package we can convert \(OR\) to \(d_p\).

```
# Example:
# OR = 1.46
<- 1.46
OR
oddsratio_to_d(OR = OR)
```

`[1] 0.2086429`