A collection of statistical functions
version: 0.4.0
This repository offers a collection of Python-based statistical methods spanning:
- hypothesis testing,
- (confidence) interval estimation,
- bootstrap and jack-knife re-sampling methods,
- Firth's logistic regression for (semi) perfect separation,
- fixed effect and random effects meta-analysis,
- tools for (survival) prediction model evaluation.
Please consult the stats-misc documentation, which includes quick-start notebooks.
Installation
The package is available on PyPI, and conda, with the latest source code available on gitlab.
Installation using PyPI
To install the package from PyPI, run:
pip install stats-misc
This installs the latest stable release along with its dependencies.
Installation using conda
A Conda package is maintained in my personal Conda channel. To install from this channel, run:
conda install afschmidt::stats-misc
Installation using gitlab
If you require the latest updates, potentially not yet formally released, you can install the package directly from GitLab.
First, clone the repository and move into its root directory:
git clone git@gitlab.com:SchmidtAF/stats-misc.git
cd stat-misc
Install the dependencies:
# From the root of the repository
conda env create --file ./resources/conda/envs/conda_create.yaml
To add to an existing environment use:
# From the root of the repository
conda env update --file ./resources/conda/envs/conda_create.yaml
Next the package can be installed:
make install
Development
For development work, install the package in editable mode with Git commit hooks configured:
make install-dev
This command installs the package in editable mode and configures Git commit
hooks, allowing you to run git pull to update the repository or switch
branches without reinstalling.
Alternatively, you can install manually:
python -m pip install -e .
python .setup_git_hooks.py
Git Hooks Configuration
When setting up a development environment, the setup-hooks command
configures Git hooks to enforce conventional commit message formatting and
spell check using codespell.
To view the commit message format requirements, run:
./.githooks/commit-msg -help
For frequent use, add this function to your shell configuration (~/.bashrc
or ~/.zshrc):
commit-format-help() {
local git_root
git_root=$(git rev-parse --show-toplevel 2>/dev/null)
if [ -z "$git_root" ]; then
echo "Error: Not inside a git repository"
return 1
fi
local hook_path="$git_root/.githooks/commit-msg"
if [ ! -f "$hook_path" ]; then
echo "Error: commit-msg hook not found"
return 1
fi
"$hook_path" --help
}
Validating the package
After installation, you may wish to run the included test suite with pytest to verify
that the package is functioning as expected.
# From the root of the repository
pytest tests
Usage
Please have a look at the examples in resources .
Metadata
Release files for stats-misc 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| stats_misc-0.4.0.tar.gz | 77.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stats_misc-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 159.6 kB
Release files / stats_misc-0.4.0.tar.gz
| Download URL | stats_misc-0.4.0.tar.gz |
|---|---|
| Size | 77.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e66e178dad749db9067775e9ba6a77e58d5e2921d3df2af620cdb7ac007c9721
|
|
BLAKE2b-256 checksum How to use checksums |
541d8db19fc7557e9ddf9ff8171c338b545f43e7e830bebcd1a2b62ae5d42f53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / stats_misc-0.4.0-py3-none-any.whl
| Download URL | stats_misc-0.4.0-py3-none-any.whl |
|---|---|
| Size | 82.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
68766e7902a00bffe0d9c6b98ac592de5c28e08fb972318da26f5ab517004453
|
|
BLAKE2b-256 checksum How to use checksums |
8902113741aacdb3eed6edc3886044982528a67a96b137d85a3d9b4779354d11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|