all the ICCs - #59
Draft
palday wants to merge 5 commits into
Draft
Conversation
"ICC" names a family of coefficients that share a form -- a ratio of a variance component to a total variance -- but answer different questions and carry different names in different literatures. Implement the widest set computable from a mixed model or a table of ratings, all behind the existing `icc` entry point, and document the taxonomy. Variance partitioning (extends the existing behaviour): - `conditional=true` includes var(Xβ) in the denominator, giving the conditional (unadjusted) ICC alongside the adjusted one. - `slopes=:mean` averages the random-effects variance over observations following Johnson (2014), so the ICC is defined for random-slope models rather than silently summing the diagonal of Σ. - `method=` selects the GLMM observation-level variance: the Nakagawa et al. (2017) `:delta`, `:lognormal` and `:trigamma` approximations for Poisson, and `:theoretical` vs `:observation_level` for binomial. - `method=:simulation` partitions variance on the response scale by simulating from the fitted model, following Goldstein et al. (2002). - `groupmean=true` gives the group-mean reliability that the organizational literature calls ICC(2) after Bliese (2000). Inter-rater reliability (new): passing a long-format table of ratings computes the six Shrout & Fleiss (1979) / McGraw & Wong (1996) coefficients with their exact F-based intervals, reproducing the published Shrout & Fleiss Table 2 values and psych::ICC's intervals. Following Liljequist et al. (2019), the default reports all six together with the variance components and a rater-bias F test, rather than requiring a model to be chosen in advance. BREAKING: two changes to existing results, both deliberate. - Random-slope ICCs change, because the Johnson (2014) average replaces the sum of the random-effect variances (sleepstudy `(1+days|subj)`: 0.477 -> 0.709). Pass `slopes=:diagonal` to recover the old values. - Poisson ICCs change, because the observation-level variance was hardcoded to 1.0, which is not one of the standard estimators. The default is now Nakagawa's `:lognormal`. Also fixes an ordering bug in the bootstrap group-mean path, where the guard for a missing `model` ran after the `_group_size` call it was meant to protect. Co-Authored-By: Claude Fable 5 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #59 +/- ##
==========================================
+ Coverage 94.21% 95.79% +1.58%
==========================================
Files 7 8 +1
Lines 190 523 +333
==========================================
+ Hits 179 501 +322
- Misses 11 22 +11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
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.
No description provided.