Nested random effects in MixedModels

What is the correct specification of nested random effects in julia’s MixedModels package?

What I’m trying to model can be done in R using lme4:

y ~ x + (1 | site / block)

so that blocks are nested in sites. How would this nesting be specified in a GeneralizedLinearMixedModel of MixedModels package?

I think that should work (at least if you’re on the latest dev branch, which you can get by doing ] add MixedModels#master. (I’m not sure if that feature was released yet or not…it looks like 2.3.0 was release after the PR supporting that syntax was merged, https://github.com/JuliaStats/MixedModels.jl/pull/197)

Also, note that that’s equivalent to (1 | site) + (1 | site & block), although support for interactions in ranef grouping expressions was also merged in the same PR.

1 Like