{ "info": { "author": "Public Health England", "author_email": "thomas.finnie@phe.gov.uk", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Science/Research", "License :: Other/Proprietary License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering :: Information Analysis" ], "description": "[![open-gov-lic](https://img.shields.io/badge/License-OGL-blue.svg)](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/) [![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n\n# bayesint\n\nThis repository includes the Python code for calculating Bayesian credible interval of ratios of independent beta distributions. It has been used in [*Methods for calculating credible intervals for ratios of beta distributions with application to relative risks of premature death during the second plague pandemic*](https://doi.org/10.1371/journal.pone.0211633)\n\n## Getting Started\n\n### Prerequisites\n\n* [Python 2.7+](www.python.org)\n\n### Installation\n\nClone the repository then run\n\n```python\npython setup.py install\n```\n\n## Usage\n\nTo get the relative risk of a contingency table given by\n\n| | + | _ | Total |\n|-------|---------|---------------|---------|\n| + | P = 56 | M- P | M = 366 |\n| - | C = 126 | N - C | N = 354 |\n| Total | C + P | N - C + M - P | N + M |\n\nrun\n\n```python\nfrom bayesint import rel_risk\nrel_risk(56, 126, 366, 354)\n# 236/549\n```\n\nand to obtain the equal-tailed quantile interval for the data given in the contingency table run\n\n```python\nfrom bayesint import eqt_int_frac\neqt_int_frac(56, 126, 366, 354, (0, 0, 0, 0), \"risk\", 0.05, \"estim\")\n# (236/549, 0.184135819539239, 0.667343920284484)\n```\n\n## Authors\n\nMaria Bekker-Nielsen Dunbar and Tom Finnie\n\n## Contributing\n\nThis project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## License\n\nPublic Health England 2017\n\nThis project is licensed under the Open Government License, see [LICENSE](LICENSE) for details\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/PublicHealthEngland/bayesint", "keywords": "", "license": "Open Government Licence 3.0", "maintainer": "Public Health England", "maintainer_email": "", "name": "bayesint", "package_url": "https://pypi.org/project/bayesint/", "platform": "", "project_url": "https://pypi.org/project/bayesint/", "project_urls": { "Homepage": "https://github.com/PublicHealthEngland/bayesint" }, "release_url": "https://pypi.org/project/bayesint/1.0.3/", "requires_dist": [ "scipy (>=0.19.1)", "sympy (>=1.1.1)", "numpy (>=1.13.3)" ], "requires_python": ">=2.7.14, !=3.0.*, !=3.1.*, !=3.3.*, !=3.4.*, >=3.5.5, >=3.6.6", "summary": "Bayesian credible intervals for ratios", "version": "1.0.3" }, "last_serial": 5132876, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "8a81c3ff646ae28f191a508bf9bf339c", "sha256": "43dc825b3830602fda21fb6b5b3e2be2de7a47d3c99d5160d35dcfcf3b870dbd" }, "downloads": -1, "filename": "bayesint-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "8a81c3ff646ae28f191a508bf9bf339c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7.14, !=3.0.*, !=3.1.*, !=3.3.*, !=3.4.*, >=3.5.5, >=3.6.6", "size": 12125, "upload_time": "2019-04-11T15:52:02", "url": "https://files.pythonhosted.org/packages/2f/ff/2b37494a38a10ed65713162fc8cfdbb4df10de0f0c6bed74002017e3cc32/bayesint-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c412a61e98c95bac3efad2406faa6c50", "sha256": "370748d8a1a410fcfd0f226b1e288a58bcec75c93095995a21d09c9b48dbeda6" }, "downloads": -1, "filename": "bayesint-1.0.3.tar.gz", "has_sig": false, "md5_digest": "c412a61e98c95bac3efad2406faa6c50", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.14, !=3.0.*, !=3.1.*, !=3.3.*, !=3.4.*, >=3.5.5, >=3.6.6", "size": 12163, "upload_time": "2019-04-11T15:52:04", "url": "https://files.pythonhosted.org/packages/f4/ab/65f740f4933ac00b594158d29c04980c8976c62f715dfa4ccd5f75a79de8/bayesint-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8a81c3ff646ae28f191a508bf9bf339c", "sha256": "43dc825b3830602fda21fb6b5b3e2be2de7a47d3c99d5160d35dcfcf3b870dbd" }, "downloads": -1, "filename": "bayesint-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "8a81c3ff646ae28f191a508bf9bf339c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=2.7.14, !=3.0.*, !=3.1.*, !=3.3.*, !=3.4.*, >=3.5.5, >=3.6.6", "size": 12125, "upload_time": "2019-04-11T15:52:02", "url": "https://files.pythonhosted.org/packages/2f/ff/2b37494a38a10ed65713162fc8cfdbb4df10de0f0c6bed74002017e3cc32/bayesint-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c412a61e98c95bac3efad2406faa6c50", "sha256": "370748d8a1a410fcfd0f226b1e288a58bcec75c93095995a21d09c9b48dbeda6" }, "downloads": -1, "filename": "bayesint-1.0.3.tar.gz", "has_sig": false, "md5_digest": "c412a61e98c95bac3efad2406faa6c50", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7.14, !=3.0.*, !=3.1.*, !=3.3.*, !=3.4.*, >=3.5.5, >=3.6.6", "size": 12163, "upload_time": "2019-04-11T15:52:04", "url": "https://files.pythonhosted.org/packages/f4/ab/65f740f4933ac00b594158d29c04980c8976c62f715dfa4ccd5f75a79de8/bayesint-1.0.3.tar.gz" } ] }