PSMatching

Build Status Coverage Status Documentation Status

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

Installation

Install psmatching via pip

$ pip install psmatching

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