PSMatching¶
Features¶
psmatching
is a package for implementing propensity score matching in Python 3.
The following functionality is included in the package:
- Calculation of propensity scores based on a specified model
- Matching of k controls to each treatment case
- Use of a caliper to control the maximum difference between propensity scores
- Matching with or without replacement
- Evaluation of the matching process using statistical methods
Usage¶
>>> # Instantiate PSMatch object
>>> m = PSMatch(path, model, k)
>>> # Calculate propensity scores and prepare data for matching
>>> m.prepare_data()
>>> # Perform matching
>>> m.match(caliper = None, replace = False)
>>> # Evaluate matches via chi-square test
>>> m.evaluate()
License¶
Apache 2.0