All Projects → ejolly → pymer4

ejolly / pymer4

Licence: MIT license
All the convenience of lme4 in python

Programming Languages

python
139335 projects - #7 most used programming language
TeX
3793 projects

Projects that are alternatives of or similar to pymer4

mixed-models-with-r-workshop-2019
Workshop on using Mixed Models with R
Stars: ✭ 22 (-83.46%)
Mutual labels:  mixed-models, lme4
Metida.jl
Julia package for fitting mixed-effects models with flexible random/repeated covariance structure.
Stars: ✭ 19 (-85.71%)
Mutual labels:  mixed-models
generalized-additive-models-workshop-2019
A workshop on using generalized additive models and the mgcv package.
Stars: ✭ 23 (-82.71%)
Mutual labels:  mixed-models
SMLP2021
Notebooks for SMLP2021
Stars: ✭ 23 (-82.71%)
Mutual labels:  mixed-models
lme4qtl
Mixed models @lme4 + custom covariances + parameter constraints
Stars: ✭ 39 (-70.68%)
Mutual labels:  lme4
formulae
Formulas for mixed-effects models in Python
Stars: ✭ 33 (-75.19%)
Mutual labels:  mixed-models
models-by-example
By-hand code for models and algorithms. An update to the 'Miscellaneous-R-Code' repo.
Stars: ✭ 43 (-67.67%)
Mutual labels:  mixed-models
bayesian-stats-with-R
Material for a workshop on Bayesian stats with R
Stars: ✭ 55 (-58.65%)
Mutual labels:  mixed-models

tests & build PyPI version Anaconda Version Anaconda Platforms Downloads DOI DOI Python Versions contributions welcome

Pymer4

❗️⚠️ Contributors wanted ⚠️❗️

Pymer4 is a statistics library for estimating various regression and multi-level models in Python. Love lme4 in R, 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. In other words, you can work completely in Python, never having to deal with R, but get (most) of lme4’s goodness. This is accomplished using rpy2 to interface between langauges.

Additionally pymer4 can fit various additional regression models with some bells, such as robust standard errors, and two-stage regression (summary statistics) models. See the features page for more information.

TL;DR this package is your new simple Pythonic drop-in replacement for lm() or glmer() in R.

For example:

# Assuming you have a pandas dataframe in tidy/long format
# with DV and IV columns for dependent/outcome vars and
# independent/predictor vars 

model = Lmer('DV ~ IV1 + IV2 + (IV+IV2|Group)', data=dataframe)

# Fit and print an R/statsmodels style summary 
# with t/z-tests, CIs, and p-values
model.fit()

# Access model attributes
model.BIC
model.residuals

# Get fitted parameters
model.coef # population parameters
model.fixef # group/cluster estimates (BLUPs)
model.ranef # group/cluster deviates

Documentation

Check out the documentation site for detailed tutorial examples, API documentation, and installation instructions!

Installation

Installing via Anaconda is the preferred installation method. Follow the directions here.

Contributing

Contributions are always welcome!
If you are interested in contributing feel free to check out the open issues, development roadmap on Trello, or submit pull requests for additional features or bug fixes. If you do make a pull request, please do so by forking the development branch and taking note of the contribution guidelines.

Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].