The vignette for {equatiomatic} includes the following example (here):
library(lme4)
library(equatiomatic)
lev1_long <- lmer(score ~ wave + (1|sid) + (1|school) + (1|district),
data = sim_longitudinal)
extract_eq(lev1_long)
which results in the resulting notation:
The different random intercepts get denoted each in their own line (I presume it is implicit that they are added together to generate the combined intercept?) and the fixed slope for wave, denoted as $\beta_1$, gets included in the first line, in the distribution of the outcome variable score. I can reproduce this example successfully.
However when I work with some data that I think has a very similar structure, I get a different notation. Here is a reproducible example with a dummy dataset:
library(tidyverse)
library(lme4)
library(equatiomatic)
mock_df <- tibble(
outcome = 1:10,
oID = c('D', 'A', 'B', 'C', 'B', 'B', 'E', 'B', 'A', 'C'),
treatment = rep(c(0, 1), each = 5),
pID = c('P1', 'P1', 'P2', 'P2', 'P2', 'P3', 'P3', 'P3', 'P4', 'P4'))
model <- lmer(outcome ~ 1 + treatment + (1|pID) + (1|oID), data = mock_df)
extract_eq(model)
Of course, the model is completely inadequate for the made-up data, but ignore that for a moment. The {equatiomatic} output is:
Just like in the vignette example, we have multiple random intercepts and one fixed slope. But the equation looks quite different. The slope has been moved to the third line, into the distribution of the random intercept for pID.
I do not really understand the reason for this difference in notation, or, for that matter, why the slope went into the distribution for the pID intercept rather than the oID intercept. Is there some actual fundamental difference in model structure between the example in the vignette and the made-up mock example I made that justifies the difference in notation?

