hedgesG

fun hedgesG(x: DoubleArray, y: DoubleArray, pooled: Boolean = true): Double(source)

Computes Hedges' g effect size, a bias-corrected version of Cohen's d for small samples.

Cohen's d overestimates the true effect size when sample sizes are small. Hedges' g corrects this by multiplying Cohen's d by a correction factor J that approaches 1.0 as sample sizes grow. For large samples (combined n > 50), the difference between Cohen's d and Hedges' g is negligible. The same conventional thresholds apply: values around 0.2, 0.5, and 0.8 are considered small, medium, and large effects.

Example:

val treatment = doubleArrayOf(2.0, 4.0, 6.0)
val control = doubleArrayOf(1.0, 2.0, 3.0)
hedgesG(treatment, control) // bias-corrected effect size
hedgesG(treatment, control, pooled = false) // with unweighted standard deviation

Return

the Hedges' g effect size.

Parameters

x

the first sample. Must contain at least 2 elements.

y

the second sample. Must contain at least 2 elements.

pooled

whether to use the pooled standard deviation when computing the underlying Cohen's d. Defaults to true. When false, uses the unweighted root-mean-square of the two group standard deviations.

See also

for the uncorrected version.