{ "info": { "author": "Omri Treidel", "author_email": "treidel2@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# cmprsk - Competing Risks Regression\nRegression modeling of sub-distribution functions in competing risks.\n\nA python wrapper around the [cmprsk](https://cran.r-project.org/web/packages/cmprsk/index.html) R package.\n\n*Description*: Estimation, testing and regression modeling of\nsubdistribution functions in competing risks, as described in Gray\n(1988), A class of K-sample tests for comparing the cumulative\nincidence of a competing risk, **Ann. Stat. 16:1141-1154, and Fine JP and\nGray RJ (1999), A proportional hazards model for the subdistribution\nof a competing risk, JASA, 94:496-509**.\n\n[Original Package documentation](https://cran.r-project.org/web/packages/cmprsk/cmprsk.pdf)\n\n## Requierments\nThis package is using `rpy2` in order to use import the cmprsk R packge and therefore the [requierments for rpy2](https://rpy2.readthedocs.io/en/version_2.8.x/overview.html?highlight=readline#requirements) must be met.\n\nTL;DR\n* Unix like OS: Linux, MacOS, BSD. (May work on Windows, look at [rpy2 binaries])(https://rpy2.readthedocs.io/en/version_2.8.x/overview.html#microsoft-s-windows-precompiled-binaries). \n* python >= 3.5\n* R >= 3.3 [how to install R](https://www.datacamp.com/community/tutorials/installing-R-windows-mac-ubuntu)\n* readline 7.0 - Should be installed as part of `rpy2`. [how to install on MacOS](http://blogs.perl.org/users/aristotle/2013/07/easy-osx-termreadlinegnu.html) see also the following [issue](https://github.com/conda-forge/rpy2-feedstock/issues/1)\n* The`cmprsk` R library (open the R consule and run `install.packages('cmprsk')`)\n\n## Quickstart\n\n### Example: crr\n\n```python\n\nimport pandas as pd\n\nimport cmprsk.cmprsk as cmprsk\n\nfrom cmprsk import utils\n\ndata = pd.read_csv('my_data_fle')\n# assuming that x1,x2,x3, x4 are covatiates. \n# x1 are x4 are categorical with baseline 'd' for x1 and 5 for x2 \nstatic_covariates = utils.as_indicators(data[['x1', 'x2', 'x3', 'x4']], ['x1', 'x4'], bases=['d', 5])\n\ncrr_result = cmprsk.crr(ftime, fstatus, static_covariates)\nreport = crr_result.summary\n\nprint(report)\n\n```\n`ftime` and `fstatus` can be numpy array or pandas series, and `static_covariates` is a pandas DataFrame.\nThe `report` is a pandas `DataFrame` as well. \n\n### Example: cuminc\n\n```python\nimport matplotlib.plt\nimport numpy as np\nimport pandas as pd\n\n\nfrom cmprsk import cmprsk\n\ndata = pd.read_csv('cmprsk/cmprsk/tests/test_set.csv')\nprint(data)\n\n\ncuminc_res = cmprsk.cuminc(data.ss, data.cc, group=data.gg, strata=data.strt)\n\n# print\ncuminc_res.print\n\n# plot using matplotlib\n\n_, ax = plt.subplots()\nfor name, group in cuminc_res.groups.items():\n ax.plot(group.time, group.est, label=name)\n ax.fill_between(group.time, group.low_ci, group.high_ci, alpha=0.4)\n\nax.set_ylim([0, 1])\nax.legend()\nax.set_title('foo bar')\nplt.show()\n\n```\n\n\n### How to update package:\n0. update version in setup.py\n1. rm -fr dist directory\n2. python setup.py sdist bdist_wheel \n3. twine upload dist/* --verbose\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/OmriTreidel/cmprsk", "keywords": "competing risks,survival analysis", "license": "", "maintainer": "", "maintainer_email": "", "name": "cmprsk", "package_url": "https://pypi.org/project/cmprsk/", "platform": "", "project_url": "https://pypi.org/project/cmprsk/", "project_urls": { "Homepage": "https://github.com/OmriTreidel/cmprsk" }, "release_url": "https://pypi.org/project/cmprsk/0.1.0/", "requires_dist": [ "numpy", "pandas", "rpy2", "scipy" ], "requires_python": "", "summary": "A python wrapper around cmprsk R package", "version": "0.1.0" }, "last_serial": 4421432, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "feb79f7c77521346d0f807641481f979", "sha256": "f72fe8ccc967a0fbd6610bcf8b601f761b895499c289c43fdcde56a9e62aa2bb" }, "downloads": -1, "filename": "cmprsk-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "feb79f7c77521346d0f807641481f979", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15399, "upload_time": "2018-10-13T06:04:15", "url": "https://files.pythonhosted.org/packages/26/de/5244a3975ed29b4c52ab30ccfeb75214e4f1a1f76b9c5ea0883a6b68b7ad/cmprsk-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9c30a2260d96528dde00dc9956bcacca", "sha256": "a25176b0cd52c3b9264b7f69b3c6394fb95dc6cef4700dc479c2d95b285a5d79" }, "downloads": -1, "filename": "cmprsk-0.0.1.tar.gz", "has_sig": false, "md5_digest": "9c30a2260d96528dde00dc9956bcacca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2547, "upload_time": "2018-10-13T06:04:16", "url": "https://files.pythonhosted.org/packages/7e/92/e8c16b4ac09e5e9ec056279dc6181db39f34f0ca142d569832cbfd77da9d/cmprsk-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "0151e27a8605d53b91c3b9c86dd4d918", "sha256": "f95d01d06540e0f560ae0982b9833213d5ecfd40ab6da408153567885ea586e0" }, "downloads": -1, "filename": "cmprsk-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "0151e27a8605d53b91c3b9c86dd4d918", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19840, "upload_time": "2018-10-20T06:20:08", "url": "https://files.pythonhosted.org/packages/5d/aa/febebff0fce509632e375daa19aeaad073a77503167b372f5f4055957de9/cmprsk-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b304d32922804645addd9c5a0649b145", "sha256": "a6ceafea9d3f5c5e576d5d584d300ac7496cd5628ff269bd1df540e67c2ade67" }, "downloads": -1, "filename": "cmprsk-0.0.2.tar.gz", "has_sig": false, "md5_digest": "b304d32922804645addd9c5a0649b145", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5632, "upload_time": "2018-10-20T06:20:09", "url": "https://files.pythonhosted.org/packages/05/64/c69306d524c4d8bb7e98519fc4a8aee9f4e299f8f988838c4d23987fb176/cmprsk-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "54564a6dfc7143a9f2c62763e0f987ee", "sha256": "5f7c06b723eed897b671fad6f9b2d05067ebc1605932914da4dbdd4bdbf0ff92" }, "downloads": -1, "filename": "cmprsk-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "54564a6dfc7143a9f2c62763e0f987ee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 21664, "upload_time": "2018-10-27T05:35:37", "url": "https://files.pythonhosted.org/packages/e9/31/f813a8f11cc56487f131bb1c698edf1287d48353508c55230e22aca4fcff/cmprsk-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "da05e245bdc621acb3405ad1e7839135", "sha256": "192bec6f6189084c117c8b4edab697fc489f80ac3c1f1d5a6cba8c5268ef36e6" }, "downloads": -1, "filename": "cmprsk-0.1.0.tar.gz", "has_sig": false, "md5_digest": "da05e245bdc621acb3405ad1e7839135", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7452, "upload_time": "2018-10-27T05:35:39", "url": "https://files.pythonhosted.org/packages/b5/34/969ef65be282c765fc9f24200fe894b8ed64b958d64a3d32eaf5e7697662/cmprsk-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "54564a6dfc7143a9f2c62763e0f987ee", "sha256": "5f7c06b723eed897b671fad6f9b2d05067ebc1605932914da4dbdd4bdbf0ff92" }, "downloads": -1, "filename": "cmprsk-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "54564a6dfc7143a9f2c62763e0f987ee", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 21664, "upload_time": "2018-10-27T05:35:37", "url": "https://files.pythonhosted.org/packages/e9/31/f813a8f11cc56487f131bb1c698edf1287d48353508c55230e22aca4fcff/cmprsk-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "da05e245bdc621acb3405ad1e7839135", "sha256": "192bec6f6189084c117c8b4edab697fc489f80ac3c1f1d5a6cba8c5268ef36e6" }, "downloads": -1, "filename": "cmprsk-0.1.0.tar.gz", "has_sig": false, "md5_digest": "da05e245bdc621acb3405ad1e7839135", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7452, "upload_time": "2018-10-27T05:35:39", "url": "https://files.pythonhosted.org/packages/b5/34/969ef65be282c765fc9f24200fe894b8ed64b958d64a3d32eaf5e7697662/cmprsk-0.1.0.tar.gz" } ] }