Mixed-effect models and ANOVA in the Tidyverse

I'd like to offer a slightly different perspective. tidymodels essentially solves two modeling problems: providing a consistent user interface to common machine learning estimators, and providing a consistent predict() method. These are rarely the modeling problems faced by researchers using mixed effects models.

If you want to use tibbles to manipulate estimates from mixed effect models, broom.mixed is definitely the way to go. broom.mixed will only help you manipulate estimates though, it won't help with model specification, checking, or inference.

IMO there are two major developments in mixed models for R at the moment. The first is the Stan ecosystem, where the Stan group is taking a Bayesian approach to mixed effects models. The brms and rstanarm vignettes are well written and present a good entrypoint to this universe. Keep an eye out for the forthcoming book Advanced Regression and Multilevel Models by Gelman et al, which will feature a number of cool recent methodological developments. The Stan ecosystem is not strictly tidy, but it is by and large well written software that is easy to use. brms is currently my go-to for mixed effects modeling due to the immense variety of tools for working with fit models after estimation (note that this is something that tidymodels hasn't focused on so far). The Stan universe also has a number of tools like tidybayes that are well worth investigating.

In terms of frequentist mixed effect modeling, there is much less active development, especially since Doug Bates (who wrote lme4) started working primarily in Julia. Nonetheless, the second set of exciting developments is recent work on mixed modeling by Emi Tanaka. You may enjoy this recent paper from her describing how to specify various mixed effects models in lme4 and asreml. Additionally, Dr. Tanaka is working on tidy experimental design, although my understanding is that this work is largely at the brainstorming stage. If you are looking for a slightly more recent reference with a more applied focus, I personally am a fan of Oehlert.

6 Likes