Skip to content

Conversation

@AndrewRidden-Harper
Copy link

These modifications make the conditional standard deviations of the random effects accessible. The output of the R code as.data.frame(ranef(model, condVar=TRUE)) is stored as an attribute of the Lmer object. While some columns of this dataframe were already accessible with other Lmer attributes, we preserve the entire dataframe as it may be useful to some users. This pull request includes a test and example use of this new feature.

ejolly and others added 30 commits December 9, 2022 16:33
* Store fits and residuals in Lm2 models. Also compute model r2 metrics

* Remove manual rhome set during dev

* lrt for lmer objects

Implement loglik ratio test analogous to the one implemented in lme4

* Fix pandas deprecated function

* Add BIC and deviance to lrt

Make output closer to lme4

* Match behaviour in R

Make sure npar are correct and other values are in the same order

* Format code with black

* Get correct AIC

AICTab in summary of an lmer fitted by REML gives the deviance, not the AIC.

* Add tests for lrt

For the moment, we use a static dump of the R output, as rpy2 seems to clash with pytest

* Add confint to test variances

* Add tests for confint

* Guard against using lrt for non Lmer models

* Temp fix for rpy2 3.5.1, but not until they fix #873 recursion error

* Bump rpy2 and pandas requirements

* Update dep versions code changes to address rpy2 deprecation warnings

* try fixing GA ci

* try fixing GA ci

* rename meta.yaml and bump numpy version

* try fixing GA ci

* try fixing GA ci

* remove deprecated future imports

* refactor code to pull out R<->Py conversion into a separate module and remove global conversion activators

* fix bug in saving confints

* fixes ejolly#88, ejolly#113

* add sklearn dependency

* initial implementation code

* use pytest fixtures for data loading

* complete working (basic) implementation of Logistic Regression

* logistic Lm estimate test against glm() in R

* add rpy2 back to requirements

* reorg workflow files to run tests only on each push/pr

* whoops remove dev branch ref

* Update Tests.yml

* try fixing GA ci

* try fixing GA ci

* try fixing GA ci

* install rpy2 from conda-forge instead of pip to see if rpy2 linking works on macos

* install rpy2 from conda-forge instead of pip to see if rpy2 linking works on macos

* try old optimizer for inverse_gaussian model

* comment out rfx only models that crash only on GA

* GA try continuing on expected failure

* fix up conda build

* fix ci

* Update Tests.yml

* Update Build.yml

* fix ci

* update meta.yaml for working local build

* Update Tests.yml

* store fits in logistic Lm and add support for .predict

* allow .predict to return probs or original scale vals. Fix bug in converting logits to probs in Lmer. Fixes ejolly#78"

* add sphinx to dev reqs and update changelog

* update gitignore

* refactor Lm a bit

Co-authored-by: Andrea Manica <[email protected]>
Allow to pass a seed to bootMer to allow for repeatable runs of confint.
@AndrewRidden-Harper AndrewRidden-Harper marked this pull request as draft July 5, 2024 01:10
@AndrewRidden-Harper AndrewRidden-Harper marked this pull request as ready for review July 5, 2024 01:10
@AndrewRidden-Harper
Copy link
Author

@ejolly Thanks for your efforts developing pymer4!

…nef_cond_std

# Conflicts:
#	.gitignore
#	conda/meta.yaml
#	docs/new.rst
#	pymer4/models/Lm.py
#	pymer4/models/Lm2.py
#	pymer4/models/Lmer.py
#	pymer4/tests/conftest.py
#	pymer4/tests/test_models.py
#	pymer4/tests/test_stats.py
#	pymer4/utils.py
#	requirements.txt
@ejolly
Copy link
Owner

ejolly commented May 21, 2025

@AndrewRidden-Harper super appreciate your work on this PR! Unfortunately, I've had to almost entirely rewrite the library the past few months to support teaching and future maintenance, and I've just made that release now (0.9.0).

The updated documentation outlines the new API, features, and functionality, including bootstrapped uncertainty around random-effects variances: https://eshinjolly.com/pymer4/

I'm happy to take PRs against this new version (main branch) including for features that haven't made the transition yet (e.g. lmerControl options). These should all be much easier to implement given the rewrites, new codebase structre, and documentation guides.

Apologies and thanks again!

@ejolly ejolly closed this May 22, 2025
@AndrewRidden-Harper
Copy link
Author

@ejolly Thanks for letting me know, and thanks for your work on this valuable package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants