It's a bit complicated
A standardized mean difference turns out to be complicated.
First, it has many names:
Second, the choice of the standardizer requires thought:
sd_pooled - used when assuming all groups have exact same variance
sd_avg - does not require assumption of equal variance
other possibilities, too, but not dealt with in this function
The choice of standardizer is important, so it's noted in the subscript:
d_s -- assumes equal variance, standardized to sd_pooled
d_avg - does not assume equal variance, standardized to sd_avg
A third complication is the issue of bias: d estimated from a sample has a
slight upward bias at smaller sample sizes. With total sample size > 30,
this slight bias becomes fairly negligible (kind of like the small upward
bias in a sample standard deviation).
This bias can be corrected when equal variance is assumed or when the
design of the study is simple (2 groups). For complex designs (>2 groups)
without the assumption of equal variance, there is now also an
approximate approach to correcting bias from Bonett.
Corrections for bias produce a long-run reduction in average bias.
Corrections for bias are approximate.
How are d and its CI calculated?
When equal variance is assumed
When equal variance is assumed, the standardized mean difference is
d_s, defined in Kline, p. 196:
d_s = sd_pooled d_s = psi / sd_s
where psi is defined in Kline, equation 7.8:
=_i=1^ac_iM_i psi = sum(contrasts*means)
and where sd_pooled is defined in Kline, equation 3.11
sd_pooled = _i=1^a (n_i -1) s_i^2 _i=1^a (n_i-1) sqrt(sum(variances*dfs) / sum(dfs))
The CI for d_s is derived from lambda-prime transformation from Lecoutre,
2007 with code adapted from Cousineau & Goulet-Pelletier, 2020. Kelley,
2007 explains the general approach for linear contrasts.
This approach to generating the CI is 'exact', meaning coverage should be
as desired if all assumptions are met (ha!).
Correction of upward bias can be applied.
When equal variance is not assumed
When equal variance is not
assumed, the standardized mean difference is d_avg, defined in Bonett,
equation 6:
d_avg = sd_avg d_avg = psi / sd_avg
Where sd_avg is the square root of the average of the group variances, as
given in Bonett, explanation of equation 6:
sd_avg = _i=1^a s_i^2 a sqrt(mean(variances))
If only 2 groups
The CI is derived from lambda-prime transformation
using df and se from Huynh, 1989 -- see especially Delacre et al., 2021
This is also an 'exact' approach, and correction can be applied
If more than 2 groups
CI is approximated using the approach from Bonett, 2008
An approximate correction developed by Bonett is used