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.3.1.tar.gz (59.7 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.3.1-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: formulae-0.3.1.tar.gz
  • Upload date:
  • Size: 59.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.12

File hashes

Hashes for formulae-0.3.1.tar.gz
Algorithm Hash digest
SHA256 c75e4600ab8d421b8e03f8b14b45e2a9124e9754e25caf9a3e3f925f0e6e53e7
MD5 4f80f8ac4f83db4fe17491f57b1e74d2
BLAKE2b-256 9f69989025c7ab22e84183137cff1b2064e7db325d5fc184eb459801a8df1a53

See more details on using hashes here.

File details

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

File metadata

  • Download URL: formulae-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 44.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.12

File hashes

Hashes for formulae-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a6bf9fd278bea86202eee8dbec5853defcf49a73162ce55c57636532e6923bb1
MD5 acaca51e97993eaea26e581e2ea548ae
BLAKE2b-256 4a3a3c5835628ac4d661b4346f3b7bbee44c66ec009f3144bc560832a746e3a4

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