Learn R Programming

PSsurvival (version 0.2.0)

calculate_overlap_weights: Calculate Overlap Weights

Description

Calculates overlap weights using the Li & Li (2019) formula for binary or multiple treatment groups. Overlap weights target the population with the most equipoise and are bounded between 0 and 1.

Usage

calculate_overlap_weights(ps_result, data, treatment_var)

Value

A numeric vector of overlap weights with length equal to nrow(data).

Arguments

ps_result

A list returned by estimate_ps(), containing:

  • ps_matrix: Matrix of propensity scores (n x J) for multiple treatments, or NULL for binary treatment

  • ps: Vector of propensity scores for observed treatment

  • n_levels: Number of treatment levels

  • treatment_levels: Vector of treatment level values

data

A data.frame containing the treatment variable.

treatment_var

A character string specifying the name of the treatment variable in data.

Details

For multiple treatments, overlap weights are calculated as: $$w_j(X_i) = \frac{1/e_j(X_i)}{\sum_{l=1}^{J} 1/e_l(X_i)}$$

For binary treatment (J=2), this reduces to: $$w(X) = 1 - P(Z = observed | X)$$ which equals the probability of receiving the opposite treatment.

References

Li, F., & Li, F. (2019). Propensity score weighting for causal inference with multiple treatments. The Annals of Applied Statistics, 13(4), 2389-2415.