Closed JCruk closed 3 years ago
Thanks, my guess is this is related to #143. Can you try installing from GitHub with remotes::install_github("datalorax/equatiomatic")
and run it again? I'm trying to run it locally to test it but, like you said, the model is taking a long time.
Just an update - the model finally converged and I did get the same error. I'll try to dig into this soon. That random effects variance-covariance matrix is massive. Theoretically it shouldn't matter so I'll try to track it down anyway, but... the equation is going to be pretty intractable.
Also - I am wondering if it does relate to the size of the model (similar to #150) because this works without a problem
m <- lme4::lmer(math ~ minority*female + (minority*female|sch.id), equatiomatic::hsb)
#> boundary (singular) fit: see ?isSingular
equatiomatic::extract_eq(m)
#> Registered S3 method overwritten by 'broom.mixed':
#> method from
#> tidy.gamlss broom
Created on 2021-02-18 by the reprex package (v0.3.0)
Just an update - the model finally converged and I did get the same error. I'll try to dig into this soon. That random effects variance-covariance matrix is massive. Theoretically it shouldn't matter so I'll try to track it down anyway, but... the equation is going to be pretty intractable.
Thanks!
I pulled the latest from github (with a force = TRUE
) and refit with less levels in both conditions and it works fine, so it is likely due to the size of the model.
# Make some data
Sim_Data <- tibble(
expand_grid(
Subject = factor(1:20),
Cond1 = factor(letters[1:3]),
Cond2 = factor( LETTERS[1:2]),
Trial = factor(c(1:5))
)
) %>%
mutate(Rand = rnorm(n()))
# Fit model
sim1 <- lmer(Rand ~ Cond1 * Cond2 + (Cond1 * Cond2|Subject), data = Sim_Data)
# Extract equation
extract_eq(sim1)
I imagine a two 5-level factor model with all interactions, everywhere, would be an infrequently encountered corner-case.
Thanks for this fantastic work!
Great! I'd still like to know why it's not working, but since we already have one issue open related to the size of the models I think I'll close this one. Thanks for the report!
I am trying to extract the equation for a model with an interaction term as slope, which results in an error:
An example (it takes a long time to run):
The equation is extracted as expected without the interaction term in the slope: