Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nesting Plot for Grouping Variables #24

Open
palday opened this issue Jul 1, 2021 · 2 comments
Open

Nesting Plot for Grouping Variables #24

palday opened this issue Jul 1, 2021 · 2 comments

Comments

@palday
Copy link
Owner

palday commented Jul 1, 2021

I'm thinking about plots of the form in this blog post, but it should be relatively straightforward to implement this as a pairs plot covering all pairs of grouping variables. This would be a more intuitive way for normal users to catch mistakes (whether in data wrangling or data collection/design) that lead to things being partially crossed instead of nested or fully crossed instead of depending on BlockDescription.

For reference, I've embedded the examples directly:

@dmbates
Copy link
Collaborator

dmbates commented Jul 7, 2021

It wasn't clear to me if the purpose of the plots in the blog post was just to illustrate the idea of nesting or as a check on nesting. For the latter case the MixedModels.isnested methods are probably more reliable. Interestingly, it is not that important to determine if grouping factors are strictly nested in our formulation. It doesn't really have a big influence on the amount of time taken to fit the model.

@palday
Copy link
Owner Author

palday commented Jul 7, 2021

In terms of accuracy of answers, isnested will of course be best. The strong focus on nesting vs. crossing is a red herring from older approaches. (Preaching not just to the choir but to the pastor here....)

I've seen a fair number of models in lme4 where users used several related grouping variables (something like "left-stimulus", "right-stimulus", "stimulus-pair" where each "left-stimulus" only appeared with a single "right-stimulus") and wound up with models that had several redundant terms. I've been trying to think of a good pedagogical visual to show the problems with this, but maybe this is something to just do ad-hoc with a DataFrame and not with a fitted model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants