All the convenience of lme4 in python
http://eshinjolly.com/pymer4 โ// momentum
// why it's here
- Active: last commit today
- Around since 2017 and still shipping
// how to help
// readme
Pymer4: Generalized Linear & Multi-level Models in Python
pymer4 is a statistics library for estimating various regression models, multi-level models, and generalized-linear-mixed models in Python. Jealous of Rโs lovely model syntax but prefer to work in the scientific Python ecosystem? This package has got you covered! pymer4 provides a clean interface that hides the back-and-forth code required when moving between R and Python. This is accomplished using rpy2 to interface between languages.
Check out the documentation here
from pymer4.models import lm, lmer
from pymer4 import load_dataset
sleep = load_dataset('sleep')
# Linear regression
ols = lm('Reaction ~ Days', data=sleep)
ols.fit()
# Multi-level model
lmm = lmer('Reaction ~ Days + (Days | Subject)', data=sleep)
lmm.fit()