-
-
Notifications
You must be signed in to change notification settings - Fork 40
Add option to pull coef() instead of ranef() for random effects #1068
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
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
d5ed019
Add option to pull coef() instead of ranef() for random effects
strengejacke bc6310c
version
strengejacke 3c3d411
fix
strengejacke f969ad8
fix
strengejacke 4fd4a4a
fix
strengejacke f7b175c
implement for glmmTMB
strengejacke a8d5d9f
remove deprecated
strengejacke 41f2940
docs
strengejacke 4d5001f
docs
strengejacke 484122d
styler, wordlist
strengejacke 76fb2e8
styler
strengejacke a21f0f5
update snapshot
strengejacke 3252d15
add test
strengejacke 725ef7b
brms
strengejacke 16d3e01
add brms method
strengejacke 8953dce
fix
strengejacke bafb30d
fix
strengejacke c2a91fc
fix
strengejacke 2e599c4
brms implementation
strengejacke f20a8cd
add missing component
strengejacke 6eed492
add rstanarm method
strengejacke cc0197d
add rstanarm method
strengejacke 8440615
news
strengejacke 9c01d30
setup air
strengejacke 720f2e4
brms auxilary
strengejacke e888c46
add test
strengejacke 02b3c10
mini styler
strengejacke 9a8bdf8
fix
strengejacke 23431f1
Apple sucks
strengejacke 1a65f02
Use remotes
strengejacke 8d4ee41
Update snap
strengejacke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| ^LICENSE | ||
| ^docs/. | ||
| ^README.Rmd | ||
| ^air.toml | ||
| ^pkgdown/. | ||
| ^paper.*$ | ||
| ^paper/. | ||
|
|
||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think now that
"random_unbiased"would be the best name...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's not finalized yet, we can change the name, if we find a name we're all happy with.
@ your component comment: We always had it composed like this, where the parameter names are "clean" and the related component is indicated in the
Componentcolumn.Should we now revise
estimate_grouplevel()? It seems it could just be a wrapper aroundmodel_parameters(..., effects = "random_<whatever>"), or isestimate_grouplevel()doing more? The implementation here supports lme4/glmmTMB/rstanarm/brms.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But
random_unbiasedsuggests the other effects are biased. But they're just deviations from the overall mean. Just curious, why are you so hesitant with"total"or"overall", since it's really just summing up fixed+random effects...And: we should have the same options for the
typeargument inestimate_grouplevel(), or not?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
The main thing is to avoid
effects="total"because it's too vague. Since it concerns random effects, I'd at least name it"random_total"so that it's clear what's it aboutNow about unbiased, well I'm not an expert of the underlying mathematics, but:
"unbiased": initially I wasn't a fan either. But 1) it has the benefit of directly linking to the now well-established literature about BLUPs (best linear unbiased). And one could understand "biased" as "relative to the fixed effect", whereas "unbiased" means "absolute". Technically we could even consider"random_relative"and"random_absolute"🤷There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do BLUPs refer to the sum of fixed and random effects? I thought it was just a description of the estimation method of random effects in general?
When there are not fixef, it's still the sum, with fixef's being zero:
Created on 2025-03-03 with reprex v2.1.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So why is it called BLUPs then? Why such a complicated name for "simply" taking the random parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are the best linear unbiased predictions of the unknown parameters (random or total slope coefficients), the same way that the OLS coefficients are the best linear unbiased estimates (BLUEs) of those unknown coefficients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That all makes sense. Incredible that I never found any clear clarification in a lot of reading. AI companies should trains their LLMs on the easystats' github issues & PRs it's a goldmine of knowledge lol
Then:
effects="random"effects="random_total"There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂