-
Notifications
You must be signed in to change notification settings - Fork 26
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
Conditional standard deviations of the random effects #141
Open
AndrewRidden-Harper
wants to merge
48
commits into
ejolly:dev
Choose a base branch
from
ucgmsim:get_ranef_cond_std
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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 <am315@cam.ac.uk>
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 <jakefaulkn@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theLmer
object. While some columns of this dataframe were already accessible with otherLmer
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.