-
Notifications
You must be signed in to change notification settings - Fork 29
Conditional standard deviations of the random effects #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* 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]>
Update to 0.8
Allow to pass a seed to bootMer to allow for repeatable runs of confint.
This reverts commit 1dcd163.
This reverts commit f6af2d7.
This reverts commit 33400d1.
Co-authored-by: Jake Faulkner <[email protected]>
PyCharm optimize imports initially changed the import order and deleted unused imports.
|
@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
|
@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 ( Apologies and thanks again! |
|
@ejolly Thanks for letting me know, and thanks for your work on this valuable package! |
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 theLmerobject. While some columns of this dataframe were already accessible with otherLmerattributes, 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.