collaboration, confidence interval, effect size, open educational resource, open scholarship, open science
15.1 From Independent Samples \(t\)-statistic
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_A\) and \(n_B\)) as well as the \(t\)-statistic from an independent sample t-test and plug it into the following formula:
Note that this only works for Student’s t-tests and not Welch’s t-test (unless the sample sizes are equal). Using the escalc() function in the metafor package we can convert \(t\) to \(d_p\) or the associated p-value from the t-test to \(d_p\).
library(metafor)# Example:# independent samples t-statistic = 3.25# nA = 50, nB = 40# calculate dp from tstats <-escalc(measure ="SMD", ti =3.25,n1i =50,n2i =40,var.names =c("dp","variance"))# display resultssummary(stats)
dp variance sei zi pval ci.lb ci.ub
1 0.6835 0.0476 0.2182 3.1331 0.0017 0.2559 1.1111
# Example:# p-value = .0016# nA = 50, nB = 40# calculate dp from p-valuestats <-escalc(measure ="SMD", pi = .0016,n1i =50,n2i =40,var.names =c("dp","variance"))# display resultssummary(stats)
dp variance sei zi pval ci.lb ci.ub
1 0.6850 0.0476 0.2182 3.1395 0.0017 0.2574 1.1127
15.2 From Paired Sample \(t\)-statistic
To calculate a within-subject standardized mean difference (\(d_z\), i.e., difference score standardizer), we can use the sample size (\(n\)) as well as the \(t\)-statistic from a paired sample t-test and plug it into the following formula:
\[
d_{z} = \frac{t}{\sqrt{n}}
\tag{15.2}\]
Note that if we want to get the repeated measures \(d_{rm}\) value we can use \(d_{rm} = d_z \times \sqrt{2(1-r)}\), but this will require the correlation between conditions. Using the escalc() function in the metafor package we can convert \(t\) to \(d_z\).
# Example:# paired t-statistic = 3.25# n = 50# calculate dz from t-statisticstats <-escalc(measure ="SMCC", ti =3.25,ni =50,var.names =c("dz","variance"))# display resultssummary(stats)
dz variance sei zi pval ci.lb ci.ub
1 0.4525 0.0220 0.1485 3.0477 0.0023 0.1615 0.7436
# Example:# p-value = 3.25# n = 50# calculate dz from p-valuestats <-escalc(measure ="SMCC", pi = .0021,ni =50,var.names =c("dz","variance"))# display resultssummary(stats)
dz variance sei zi pval ci.lb ci.ub
1 0.4523 0.0220 0.1485 3.0462 0.0023 0.1613 0.7433
15.3 From Pearson Correlation
If a Pearson correlation is calculated between a continuous score and a dichotomous score (grouping variable with groups \(A\) and \(B\)), this is considered a point-biserial correlation. The point-biserial correlation can be converted into a \(d_p\) value using the following formula:
This method is the called the logit method as it uses the variance of the logistic distribution, however, it may actually be preferable to use the Cox logit method which is simply,
\[
d_{p} = \frac{\log(OR)}{1.65}
\tag{15.6}\]
Using the oddsratio_to_d function in the effectsize package we can convert \(OR\) to \(d_p\) with the logit method. we will use base R to calculate \(d_p\) with the Cox logit method.
library(effectsize)# Example:# OR = 1.46OR <-1.46# calculate dp using logit methododdsratio_to_d(OR = OR)