PsmPy

PsmPy implements propensity score matching in Python to match treated and untreated subjects based on observed covariates for causal effect estimation in retrospective cohort studies.


Key Features:

  • Logistic Regression-Based Propensity Score Calculation: Uses logistic regression to compute propensity scores representing the probability of treatment assignment conditional on observed covariates.
  • K-Nearest Neighbors (k-NN) Matching Algorithm: Performs k-NN matching on propensity scores to pair treated and untreated cases with similar covariate profiles.
  • Plotting and Visualization: Provides plotting capabilities for assessing propensity score distributions and post-matching balance.

Scientific Applications:

  • Causal Effect Estimation in Retrospective Cohort Studies: Estimates treatment effects by matching treated and untreated subjects to approximate randomized comparisons.
  • Confounding Control in Observational Studies: Reduces bias from observed confounders when estimating treatment effects through propensity score matching.

Methodology:

Computes propensity scores via logistic regression, applies k-nearest neighbors matching on propensity scores, and benchmarks performance against the R package MatchIt using a Mann–Whitney test (U=49, p<0.0001) reporting an average 10-fold improvement in reduction of residual effect sizes among covariates.

Topics

Details

License:
MIT
Cost:
Free of charge
Tool Type:
library
Operating Systems:
Mac, Linux, Windows
Programming Languages:
Python, R
Added:
11/3/2022
Last Updated:
11/24/2024

Operations

Publications

Kline A, Luo Y. PsmPy: A Package for Retrospective Cohort Matching in Python. 2022 44th Annual International Conference of the IEEE Engineering in Medicine &amp; Biology Society (EMBC). 2022. doi:10.1109/embc48229.2022.9871333. PMID:36086543.

PMID: 36086543
Funding: - NIH: U01TR003528,R01LM013337