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.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 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.5.3.tar.gz (149.8 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.5.3-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: formulae-0.5.3.tar.gz
  • Upload date:
  • Size: 149.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for formulae-0.5.3.tar.gz
Algorithm Hash digest
SHA256 b2d42e437cb138c2eaf8ae651bab98d27c6182f63b75bf8d3f51d873a0fe9e13
MD5 b90ccc971fc5b177e1780449e7ebd739
BLAKE2b-256 1932dfdf1ba7f990584c391bdef3fa339506d5183b2efb5ec69cd20f6201f9fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: formulae-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 53.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for formulae-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e0032263aabb84aeaa8edf60f4ed3bba95e7bc8c8331d95ac667157f8ab01f81
MD5 01e92e920ec7837d930f162ea2ec0ce7
BLAKE2b-256 70d84e5ab4da2b633741a4ce223f760156551f5aba201791b4dc504ba9b4ff07

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