Computes the standardized mean difference (Hedges' g) between a treatment and a comparison group for a single numeric covariate, using the pooled within-group standard deviation and the small-sample correction factor used by the What Works Clearinghouse (WWC).
Arguments
- x
Numeric vector of covariate values.
- treatment
Vector the same length as
xidentifying group membership. Must have exactly two unique non-missing values. The larger value (e.g.1,TRUE, or the second sorted level) is treated as the treatment group; the other as the comparison group.- na.rm
Logical; drop rows where
xortreatmentisNA. DefaultTRUE.
Value
A single numeric value: Hedges' g. Positive when the treatment group mean exceeds the comparison group mean.
Details
The correction factor is \(\omega = 1 - 3 / (4N - 9)\), where \(N = n_{treatment} + n_{comparison}\).