opmatch


Nameopmatch JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/kirilklein/opmatch
SummaryA leightweight package to perform optimal case-control matching.
upload_time2022-12-03 17:11:22
maintainer
docs_urlNone
authorKiril Klein
requires_python>=3.7, <4
licenseMIT
keywords matching statistics epidemiology causal inference propensity score optimal matching case-control matching matching algorithms matching methods pharmacoepidemiology
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            The package provides the following matching methods:
* **optimal match**
    + one-to-one match
    + one-to-many match
    + variable ratio match
    + full match (not implemented yet)
* **greedy match**
    + not implemented yet

All matching methods support covariate and propensity score matching.

To obtain matches you can simply run:

```python
from opmatch.matcher import Matcher
case_control_dict = Matcher(
        df, matching_ratio, 
        min_mr, max_mr, n_controls, 
        metric, matching_type,
        case_col, var_cols,  ps_col,
        ).match()
```
>#### Parameters

* **matching_ratio** number of controls per case if matching ratio is constant

* **min_mr**: minimum number of controls per case
* **max_mr**: maximum number of controls per case
* **n_controls**: number of controls to match
* **metric**: PS or one of the metrics accepted by scipy.spatial.distances.cdist
* **matching_type**: constant or variable matching ratio
* **case_col**: boolean column where cases are 1s and controls 0s
* **var_cols**: columns containing relevatn patient variables
        if metric!=PS: var_cols used for matching
        if metric==PS but ps_col is not specified: var_cols used to compute PS using logistic regression
* **ps_col**: column containing the propensity score
* **case_col**: column name of case column, should contain 1s and 0s

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kirilklein/opmatch",
    "name": "opmatch",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7, <4",
    "maintainer_email": "",
    "keywords": "matching,statistics,epidemiology,causal inference,propensity score,optimal matching,case-control matching,matching algorithms,matching methods,pharmacoepidemiology",
    "author": "Kiril Klein",
    "author_email": "kikl@di.ku.dk",
    "download_url": "https://files.pythonhosted.org/packages/42/ce/2eb8f9975ff1ce4c18440eccb272edf70b75353a642ef5086771f112f061/opmatch-1.0.1.tar.gz",
    "platform": null,
    "description": "The package provides the following matching methods:\r\n* **optimal match**\r\n    + one-to-one match\r\n    + one-to-many match\r\n    + variable ratio match\r\n    + full match (not implemented yet)\r\n* **greedy match**\r\n    + not implemented yet\r\n\r\nAll matching methods support covariate and propensity score matching.\r\n\r\nTo obtain matches you can simply run:\r\n\r\n```python\r\nfrom opmatch.matcher import Matcher\r\ncase_control_dict = Matcher(\r\n        df, matching_ratio, \r\n        min_mr, max_mr, n_controls, \r\n        metric, matching_type,\r\n        case_col, var_cols,  ps_col,\r\n        ).match()\r\n```\r\n>#### Parameters\r\n\r\n* **matching_ratio** number of controls per case if matching ratio is constant\r\n\r\n* **min_mr**: minimum number of controls per case\r\n* **max_mr**: maximum number of controls per case\r\n* **n_controls**: number of controls to match\r\n* **metric**: PS or one of the metrics accepted by scipy.spatial.distances.cdist\r\n* **matching_type**: constant or variable matching ratio\r\n* **case_col**: boolean column where cases are 1s and controls 0s\r\n* **var_cols**: columns containing relevatn patient variables\r\n        if metric!=PS: var_cols used for matching\r\n        if metric==PS but ps_col is not specified: var_cols used to compute PS using logistic regression\r\n* **ps_col**: column containing the propensity score\r\n* **case_col**: column name of case column, should contain 1s and 0s\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A leightweight package to perform optimal case-control matching.",
    "version": "1.0.1",
    "split_keywords": [
        "matching",
        "statistics",
        "epidemiology",
        "causal inference",
        "propensity score",
        "optimal matching",
        "case-control matching",
        "matching algorithms",
        "matching methods",
        "pharmacoepidemiology"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "6e04db99b8ea27c5bfad4099003c2d8a",
                "sha256": "72005b27353a6135c143b221f97747b94d295bd3b654753cace51aba2a39d6ab"
            },
            "downloads": -1,
            "filename": "opmatch-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6e04db99b8ea27c5bfad4099003c2d8a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7, <4",
            "size": 7741,
            "upload_time": "2022-12-03T17:11:22",
            "upload_time_iso_8601": "2022-12-03T17:11:22.143900Z",
            "url": "https://files.pythonhosted.org/packages/42/ce/2eb8f9975ff1ce4c18440eccb272edf70b75353a642ef5086771f112f061/opmatch-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-03 17:11:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "kirilklein",
    "github_project": "opmatch",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "opmatch"
}
        
Elapsed time: 0.01326s