Skip to content

rickydangc/psmatching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

psmatching

Propensity Score Matching Python Package

  • Calculation of propensity scores based on LR model
  • Matching of k controls to each case patient
  • Use of a caliper to control the maximum difference between propensity scores

Install psmatching

python setup.py install

pip install git+https://github.com/rickydangc/psmatching

Usage

import psmatching.match as psm

path = "./sample.csv"
model = "CASE ~ AGE + ENCODED_SEX + ENCODED_RACE + ENCODED_CCI_GROUP"
gap = 180
k = "5"

ps = psm.PSMatch(path, model, k, gap)
ps.prepare_data()
caliper = ps.set_caliper('logit', 0.01)
ps.match_by_neighbor(caliper)

Simple Run

ps.run()

About

Propensity Score Matching Python Package

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages