Skip to main content

Formulas for mixed-effects models in Python

Project description

PyPI version codecov Code style: black

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.8+) and the libraries NumPy, SciPy and Pandas with versions specified in the pyproject.toml 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 class pandas.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

formulae-0.6.1.tar.gz (147.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

formulae-0.6.1-py3-none-any.whl (54.6 kB view details)

Uploaded Python 3

File details

Details for the file formulae-0.6.1.tar.gz.

File metadata

  • Download URL: formulae-0.6.1.tar.gz
  • Upload date:
  • Size: 147.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for formulae-0.6.1.tar.gz
Algorithm Hash digest
SHA256 49586412cb7dcda90c2737b7d1bfb03deb9912867421bc082395c444cc661da2
MD5 982fcd8ff799fffdc94f023e0ac4afde
BLAKE2b-256 8719436489e83c0cf955189af4f47f6fa1d2c474db98f034c3d47fec3381b94d

See more details on using hashes here.

File details

Details for the file formulae-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: formulae-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 54.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for formulae-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 caa044a948e1b44f4dc187061f33c24ba8bbf2dba9269e1212ee2e8b82dc99aa
MD5 7f95d31e698fe8fe0a13c9912a70c368
BLAKE2b-256 4657ca132639b839fe508223b895e28ac344b378289dd57765f5410e915e1fee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page