Skip to main content

Treatment group, control group matching algorithm high level python implementation.

Project description

Introduction

The Treatment and control group experiment is widely used in comparative experiments. For a big group of people having similar circumstance, if treatments are applied and we see it works, Bingo, we got what we want to prove now. Knock Knock! Welcome back to reality. In real worlds, it is usually very difficult to find large amount of people having similar circumstance. So what we do is only apply treatments to small amount of people, and then select similar people from public. Then we can start comparison.

This, is control treatment matching.

ctmatching is a stratified propensity score matching algorithm python implementation built on numpy, pandas, sklearn. Thanks for standing on the shoulders of these giants.

For more information about Installation, Usage, API and full documentation:

Download and Install

ctmatching requires numpy >= 1.8.1, scipy >= 0.14.1, pandas >= 0.14.1, scikit-learn >= 0.15.2.

ctmatching is released on PyPI, so all you need is:

$ pip install ctmatching

To upgrade to latest version:

$ pip install --upgrade ctmatching

If you want to build the source by your self, download the source code and:

$ cd ctmatching-project
$ python setup.py build
$ python setup.py install

中文介绍(Chinese Introduction)

Propensity score matching (PSM) 倾向评分匹配

PSM主要用于生物统计中。在生物统计中, 很多实验都要设置``对照组/控制组(control group)``和``实验组(treatment group)``。在一个精心设计的实验中, 对照组和实验组通常在除了实验所导致的结果部分, 都要保证其他情况尽量一致, 这样实验结果才有说服力。

例如我们研究X药品对A疾病的治疗效果, 如果我们选择100个病人, 他们的身体状况都比较相似, 给其中50个人吃药, 另外50个人不吃药。如果过了一个月对照组中的病人有30%身体恶化, 10%的状态不变, 10%的稍许好转。而实验组中的病人有30%都有好转, 那么我们大体上可以说明这个药是有效的。

但是, 在实际的实验中我们通常做不到这一点。因为我们很难找到大量的状态相似的实验对象。同样是X药品和A疾病的例子:

我们在测试A药对B病的治疗效果, 于是我们对50名病病人做实验, 给他们吃了药。接着就需要到社会上找与这50名病人情况类似, 但没有吃药的病人。为了研究X药的有效性, 对于每一个病人我们需要以某种方式在社会中找到他们的对照组。而这种匹配的方法, 就叫PSM。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ctmatching-0.0.5.zip (29.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page