Propensity Score Matching Python-based code
Authors/Creators
Description
This repository offers a free, Python-based code for performing propensity score (PS) matching. As an initiative of the Camargo Cohort Study, it has been developed for clinicians and researchers with the aim of sharing the tool and disseminating the use of PS matching.
The code overcomes compatibility issues with R versions and R packages, and implements (i) logistic regression to compute PS, (ii) 1:N matching using the K-nearest neighbour (KNN) algorithm with a customisable caliper, (iii) sampling with/without replacement, and (iv) visualisations to assess matching quality.
Outputs: Matched pairs stored as .csv file. Matched pairs can be easily identified, allowing a Coxreg to be performed. In addition, 5 diagnostic plots are saved in the specified output folder.
The code has been developed with support and refinement from OpenAI's ChatGPT.
Notes
Notes
Files
PS_boxplot.png
Files
(290.7 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:b05166e598e481957dfa4688a2a143eb
|
35.5 kB | Preview Download |
|
md5:f0adb2da820c0f5a51ffcb1caf32e35e
|
68.6 kB | Preview Download |
|
md5:3407b5bd0ae4203645a550092604e91e
|
45.8 kB | Preview Download |
|
md5:d06169ae8d607026c43c5db61787a5a5
|
11.3 kB | Download |
|
md5:a0488ea4c27484f2808e0b93bb0b2b34
|
10.8 kB | Download |
|
md5:73e40f927929f1bd2394a049acd88702
|
58.0 kB | Preview Download |
|
md5:390d9fc407b70120e59648769a739352
|
60.8 kB | Preview Download |
Additional details
Dates
- Updated
-
2025-01-11
Software
- Repository URL
- https://github.com/epsar-co/Propensity-Score-Matching-Python-based-code.git
- Programming language
- Python