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

Going to/from mixed model formulas and Hasse diagrams #25

Open
alexpghayes opened this issue Mar 6, 2019 · 7 comments
Open

Going to/from mixed model formulas and Hasse diagrams #25

alexpghayes opened this issue Mar 6, 2019 · 7 comments

Comments

@alexpghayes
Copy link

One nice way to visualize mixed models is through a Hasse diagram, as in chapter 12 of this book. We should make a tool to make these visuals easy in R, especially the notation specific to mixed effects models. It would interesting to be able to from a lme4 / brms / rstanarm model (or just the formula) to a Hasse diagram, and from a Hasse diagram to a model formula.

I wonder if this could lead to visualizations of the decomposition of variance in a multilevel model as at https://mgb-research.netlify.com/post/visualizing-variance-in-multilevel-models-using-the-riverplot-package/.

@alexpghayes
Copy link
Author

Example of Hasse diagrams

image

Possible visualize decomposition of variance

image

Would also be interesting to visually differentiate flows in some way to distinguish between fixed and random effects

@alexpghayes
Copy link
Author

We'd probably want to start with the balanced case and then extend to the unbalanced case.

@IndrajeetPatil
Copy link

This might be easy to achieve using the riverplot package. Not sure if there is a related cousin in the ggplot framework.

image

@wlandau
Copy link

wlandau commented Mar 6, 2019

I have enjoyed networkD3::sankeyNetwork() for Sankey diagrams. Maybe tidygraph could help bridge the gap if we want an appealing API?

@tjmahr
Copy link

tjmahr commented Mar 6, 2019

The Hasse diagram is inscrutable, but the decomposition rivers are nice. Can we leverage D3 and r2d3 at all?

@wlandau
Copy link

wlandau commented Mar 7, 2019

What about the latest release of ggforce? Could geom_parallel_sets() help? Maybe ggalluvial?

@benlistyg
Copy link

I (kinda) did a blog post on this based on a paper by Rouder et al.

http://rpubs.com/blistyg/networksofmodels

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

5 participants