Formulas for mixed-effects models in Python
Project description
formulae
formulae is a Python library that implements Wilkinson's formulas for mixed-effects models. The main difference with other implementations like Patsy or formulaic is that formulae can work with formulas describing a model with both common and group specific effects (a.k.a. fixed and random effects, respectively).
This package has been written to make it easier to specify models with group effects in Bambi, a package that makes it easy to work with Bayesian GLMMs in Python, but it could be used independently as a backend for another library. The approach in this library is to extend classical statistical formulas in a similar way than in R package lme4.
Installation
formulae requires a working Python interpreter (3.7+) and the libraries numpy, scipy and pandas with versions specified in the requirements.txt file.
Assuming a standard Python environment is installed on your machine (including pip), the latest release of formulae can be installed in one line using pip:
pip install formulae
Alternatively, if you want the development version of the package you can install from GitHub:
pip install git+https://github.com/bambinos/formulae.git
Documentation
The official documentation can be found here
Notes
- The
data
argument only accepts objects of classpandas.DataFrame
. y ~ .
is not implemented and won't be implemented in a first version. However, it is planned to be included in the future.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file formulae-0.5.4.tar.gz
.
File metadata
- Download URL: formulae-0.5.4.tar.gz
- Upload date:
- Size: 149.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 150c8ddf985234fb1f1f2b7471d299432efef43f54ea8524eee391b8929caa70 |
|
MD5 | 60b2fef82442121090cb1fbdba1961d7 |
|
BLAKE2b-256 | 7d645ad6998310894e5678f91f44c20662915f8384af2c647f97c97dfec17f07 |
File details
Details for the file formulae-0.5.4-py3-none-any.whl
.
File metadata
- Download URL: formulae-0.5.4-py3-none-any.whl
- Upload date:
- Size: 53.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6ee8150c1321f8c034e94e4a097f6af7c239d6d19a463c0398129e444e9b538 |
|
MD5 | 6db9d4b59053f11f1621595d5b4990fc |
|
BLAKE2b-256 | 8812808e8b17e09b60a31ab324d638e50f8cdc11dfcdafb4874a43afad296a2e |