You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if you have a formula like y ~ 1 + (1|G) + (0+A|G) where A is a categorical variable with n levels, then you'll generate 1 variance term for the random intercept, and n terms for A, leading to an overparametrized model. This may not be what you want; listing these as separate terms is a way to indicate that you want to zero out the correlation terms between the random intercept and the random slopes for A, and you end up changing the number of variance terms (relative to the (1+A|G) formula).
This can be fixed by changing the way that the schema is applied. Currently, a fresh StatsModels.FullRank schema is prepared for every random effect term, meaning that the 0+A is treated as independent from the 1. An alternative approach would be to add yet another level of schema wrapping (which I'll prepare a PR for), which stores one FullRank schema for each grouping variable and applies it across multiple terms. But this is a breaking change and may require changing how amalgamate works as well. It's tested here:
Currently, if you have a formula like
y ~ 1 + (1|G) + (0+A|G)
whereA
is a categorical variable withn
levels, then you'll generate 1 variance term for the random intercept, andn
terms forA
, leading to an overparametrized model. This may not be what you want; listing these as separate terms is a way to indicate that you want to zero out the correlation terms between the random intercept and the random slopes forA
, and you end up changing the number of variance terms (relative to the(1+A|G)
formula).This can be fixed by changing the way that the schema is applied. Currently, a fresh
StatsModels.FullRank
schema is prepared for every random effect term, meaning that the0+A
is treated as independent from the1
. An alternative approach would be to add yet another level of schema wrapping (which I'll prepare a PR for), which stores oneFullRank
schema for each grouping variable and applies it across multiple terms. But this is a breaking change and may require changing how amalgamate works as well. It's tested here:MixedModels.jl/test/pls.jl
Lines 277 to 290 in c87e8d1
The text was updated successfully, but these errors were encountered: