This is a collection of helpful utilities and recipes for biostatistics analyses in Python/SciPy. The objective is to (where possible) wrap existing implementations of statistical functions to provide a convenient and consistent interface, which reduces boilerplate, and reports results in a user-friendly standard format for medical research (cf. APA, AMA, NEJM style).
For example, compare the standard statsmodels code:
This is a *personal* helper library, whose scope is limited to statistical functions and applications which are useful to me. It is not intended or expected that you will necessarily be able to import the library wholesale for your purposes. Rather, in the spirit of collaboration it is hoped that this library may contain examples and generally standalone implementations (hence ‘utilities and recipes’) which may be helpful for you to use or adapt.
## Dependencies
The mandatory dependencies of this library are:
* [NumPy](https://numpy.org/), tested on 1.23.3
* [pandas](https://pandas.pydata.org/), tested on 1.4.4
* [SciPy](https://scipy.org/), tested on 1.9.2
* [statsmodels](https://www.statsmodels.org/), tested on 0.13.2
Optional dependencies are:
* [mpmath](https://mpmath.org/), for *beta_ratio* and *beta_oddsratio*
Each function is documented in the respective docstring within the source code, and Sphinx documentation is buildable from the *docs* directory. Examples can be found in the unit tests in the *tests* directory.
No warranty is made as to the correctness of any function in this library. While the library is unit tested, the validation is not extensive. This applies particularly for functions which are more than simple wrappers for existing implementations. Please apply appropriate caution.