-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
marginalmeans backend for estimate_means() #214
Comments
marginaleffects has its own datagrid function, so passing a grid is definitely possible. The purpose of marginal means over get_predicted is if you want to marginalize over other predictors (eg, average mean in control group across ethnic groups). marginaleffects has several options for how to handle continuous variables when averaging |
To begin, let me introduce a conceptual difference between two functions:
In almost all of the examples you show, there is no averaging across categorical variables going on in Before that, I'll give a few examples of
Now, replications of your examples:
|
Of course, you can use the |
#248 as reminder/reference. I have some experience now in wrapping marginaleffects functions to get the desired results, so maybe we can try to continue on this issue. The major distinctions/use cases I see (but feel free to correct/add):
Furthermore, for mixed models:
Once we have these different WDYT? |
Okay I made a few attempts, but the issue is I cannot seem to be able to pass a datagrid to
marginaleffects::marginalmeans()
. Which blocks me from doing things like:Created on 2022-09-26 by the reprex package (v2.0.1)
Basically controlling at which levels of Sepal.Width I want the means. Is that the right way of doing it or should one directly use predictions on the datagrid?
@bwiernik is there a reason do use marginalmeans() over simply get_predicted on the datagrid one wants the means of? (@vincentarelbundock but I don't wanna tag you each time I need help with some probably basic thing ^^)
The text was updated successfully, but these errors were encountered: