Computes the What Works Clearinghouse (WWC) Cox index, a standardized effect size for a binary (dichotomous) covariate. The Cox index places the difference between two proportions on a scale comparable to Hedges' g, so it can be classified with the same baseline-equivalence thresholds.
Arguments
- x
A binary covariate (numeric
0/1, logical, two-level factor, or any vector with exactly two unique non-missing values). The larger value (e.g.1,TRUE, or the second sorted level) is treated as the "event".- treatment
Vector the same length as
xidentifying group membership; exactly two unique non-missing values (seehedges_g()).- na.rm
Logical; drop rows where
xortreatmentisNA. DefaultTRUE.
Value
A single numeric value: the Cox index. Returns NA (with a warning)
when a group proportion is exactly 0 or 1, where the index is undefined.
Details
The index is \(d_{Cox} = (\mathrm{logit}(p_t) - \mathrm{logit}(p_c)) / 1.65\), where \(p_t\) and \(p_c\) are the proportions in the "event" category for the treatment and comparison groups.