overlap_coef: Bhattacharyya overlap coefficient for propensity score...

View source: R/overlap_coef.R

overlap_coefR Documentation

Bhattacharyya overlap coefficient for propensity score distributions

Description

Two calling conventions are provided:

From propensity scores (empirical):

Supply ps and Z. The empirical formula is

\hat\phi = \frac{\mathrm{E}[\sqrt{e(1-e)}]}{\sqrt{r(1-r)}},

where r = \mathrm{E}[Z]. This is the sample mean of \sqrt{e_i(1-e_i)} divided by \sqrt{\hat r(1-\hat r)}.

From Beta parameters (analytical):

Supply a and b. Under the \mathrm{Beta}(a,b) approximation,

\phi = \exp\!\Bigl[ \log\Gamma(a+\tfrac12) - \tfrac12\log a - \log\Gamma(a) + \log\Gamma(b+\tfrac12) - \tfrac12\log b - \log\Gamma(b) \Bigr].

Usage

overlap_coef(ps = NULL, Z = NULL, a = NULL, b = NULL)

Arguments

ps

Numeric vector of estimated propensity scores e_i = \Pr(Z_i = 1 \mid X_i), all in (0, 1). Required when a and b are not supplied.

Z

Integer or numeric vector of treatment indicators (Z_i \in \{0, 1\}), the same length as ps. Required when ps is supplied.

a

Shape parameter a > 0 of the Beta distribution. Supply together with b to use the analytical formula.

b

Shape parameter b > 0 of the Beta distribution. Supply together with a to use the analytical formula.

Details

Computes the Bhattacharyya overlap coefficient \phi, a scalar measure of propensity score overlap between the treatment and control groups. Values close to 1 indicate near-complete overlap (little confounding); values well below 1 indicate poor overlap.

Value

A list with components:

phi

The overlap coefficient \hat\phi.

r

Treatment proportion: mean(Z) (empirical) or a / (a + b) (analytical).

References

Chengxin Yang, Bo Liu, and Fan Li. Sample size and power calculations for causal inference with time-to-event outcomes. arXiv preprint arXiv:2605.10088 (2026).

Bo Liu, Chengxin Yang, and Fan Li. Sample size and power calculations for causal inference with continuous and binary outcomes. Annals of Statistics (2026).

See Also

power_ps, power_cox

Examples

# From propensity scores
set.seed(1)
n  <- 500
X  <- rnorm(n)
ps <- plogis(0.5 * X)
Z  <- rbinom(n, 1, ps)
overlap_coef(ps = ps, Z = Z)

# From Beta parameters
overlap_coef(a = 2, b = 3)


PSpower documentation built on May 14, 2026, 9:07 a.m.