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

Additional details in documentation for Grouping() #538

Closed
oizin opened this issue Jul 5, 2021 · 4 comments
Closed

Additional details in documentation for Grouping() #538

oizin opened this issue Jul 5, 2021 · 4 comments

Comments

@oizin
Copy link

oizin commented Jul 5, 2021

Hi, great package, I just have a small suggestion for the documentation.

I was using MixedModels to fit a model with many levels and got the following error:

┌ Warning: Random effects grouping variables with many levels can cause out-of-memory errors.  Try manually specifying `Grouping()` contrasts for those 
variables.

It took me a while to figure out how to use Grouping() and contrasts, until I saw the example in the tests below. I think it would be worth having something like fit(MixedModel, @formula(y ~ 1 + (1 | grp)), d, contrasts=Dict(:grp => Grouping())) in the documentation for Grouping.

https://github.com/JuliaStats/MixedModels.jl/blob/aae37e9dd724d6eb8ded292a9a8798300bb2a562/test/grouping.jl

Happy to create a pull request if you think this is worthwhile.

@palday
Copy link
Member

palday commented Jul 13, 2021

We hadn't given much more documentation previously because we had only encountered it in a few places in the wild and Grouping() works like any other contrasts / hints for the StatsModels formula interface.

That said, it would be a great thing to have it better documented. Do you have an idea for where to document it so that it's easily discoverable?

@kleinschmidt
Copy link
Member

My suggestion would be to make sure the docstring for Grouping explains how to use it (with an example invocations for lm and fit) and add a pointer to the docstring in the warning message (something like "for more, see ?Grouping")

@kleinschmidt
Copy link
Member

And a PR would be most welcome @oizin !

@palday
Copy link
Member

palday commented Jan 26, 2025

I'm closing this since Grouping is now automagically applied. 😎

@palday palday closed this as completed Jan 26, 2025
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

3 participants