Skip to content

added text in constructors.md to say NaN correlation is printed as a dot, fixes #819 #822

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ajinkya-k
Copy link
Contributor

fixes #819

Copy link

codecov bot commented Mar 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.33%. Comparing base (1be8517) to head (0eb0e3c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #822   +/-   ##
=======================================
  Coverage   97.33%   97.33%           
=======================================
  Files          36       36           
  Lines        3495     3495           
=======================================
  Hits         3402     3402           
  Misses         93       93           
Flag Coverage Δ
current 96.99% <ø> (ø)
minimum 97.33% <ø> (ø)
nightly 96.92% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dmbates
Copy link
Collaborator

dmbates commented Mar 31, 2025

I think we might try to explain that result a little better while we are making this correction. The output looks like

julia> m1 = fit(MixedModel, @formula(reaction ~ 1 + days + (1|subj) + (days|subj)), MixedModels.dataset(:sleepstudy); contrasts=Dict(:days => DummyCoding()))
Minimizing 3068    Time: 0:00:00 ( 0.14 ms/it)
Linear mixed model fit by maximum likelihood
 reaction ~ 1 + days + (1 | subj) + (days | subj)
   logLik   -2 logLik     AIC       AICc        BIC    
  -819.1592  1638.3185  1752.3185  1806.5152  1934.3170

Variance components:
            Column    Variance  Std.Dev.   Corr.
subj     (Intercept)   882.08342 29.69989
         days: 1       403.87992 20.09676   .  
         days: 2       785.87492 28.03346   .   +0.76
         days: 3      1160.51146 34.06628   .   +0.74 +0.89
         days: 4      1375.06073 37.08181   .   +0.58 +0.67 +0.93
         days: 5      2177.61478 46.66492   .   +0.44 +0.42 +0.72 +0.85
         days: 6      3730.64143 61.07898   .   +0.27 +0.48 +0.70 +0.78 +0.76
         days: 7      1688.60255 41.09261   .   +0.16 +0.41 +0.55 +0.59 +0.64 +0.72
         days: 8      3029.32800 55.03933   .   +0.25 +0.32 +0.59 +0.71 +0.91 +0.73 +0.75
         days: 9      2999.41317 54.76690   .   +0.24 +0.11 +0.41 +0.57 +0.78 +0.38 +0.53 +0.86
Residual                54.66356  7.39348
 Number of obs: 180; levels of grouping factors: 18

  Fixed-effects parameters:
───────────────────────────────────────────────────
                 Coef.  Std. Error      z  Pr(>|z|)
───────────────────────────────────────────────────
(Intercept)  256.652       7.21398  35.58    <1e-99
days: 1        7.84395     5.33962   1.47    0.1418
days: 2        8.71009     7.05219   1.24    0.2168
days: 3       26.3402      8.3992    3.14    0.0017
days: 4       31.9976      9.08108   3.52    0.0004
days: 5       51.8667     11.2717    4.60    <1e-05
days: 6       55.5265     14.6059    3.80    0.0001
days: 7       62.0988      9.99425   6.21    <1e-09
days: 8       79.9777     13.2049    6.06    <1e-08
days: 9       94.1994     13.1418    7.17    <1e-12
───────────────────────────────────────────────────

and the dots are in the correlations of the random effects of days: 1 with other days: x random effects and the "variance component" is not estimated as zero. This is an over-specified model (more random effects than observations) so I am not even sure what these numbers mean.

Perhaps we could find a better example to illustrate the point we are trying to make. If someone (@palday ?) could tell me what the point of the discussion is, I can take a stab at illustrating it.

@palday
Copy link
Member

palday commented Apr 1, 2025

I agree it's a bad example. If I recall correctly, the idea was to show the interaction of the amalgamate behavior with categorical predictors

@dmbates
Copy link
Collaborator

dmbates commented Apr 1, 2025

BTW, I was incorrect about an over-specified model because the days: 0 random effects are dropped. However, I'm still not sure what the model means.

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.

NaN correlation in documentation
3 participants