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

In-house processing of marginaleffects objects #1063

Open
DominiqueMakowski opened this issue Jan 11, 2025 · 5 comments
Open

In-house processing of marginaleffects objects #1063

DominiqueMakowski opened this issue Jan 11, 2025 · 5 comments
Labels
Enhancement 💥 Implemented features can be improved or revised

Comments

@DominiqueMakowski
Copy link
Member

Currently we call the tidy() function,

out <- insight::standardize_names(
marginaleffects::tidy(model, conf_level = ci, ...),
style = "easystats"
)

which is defined here: https://github.com/vincentarelbundock/marginaleffects/blob/a6730a3560dbf4220d4bf82da141400fa235b996/sandbox/tidy_old.R#L92

But this strongly limits our capabilities (especially in Bayesian cases). We should probably not rely on tidy and reimplement it using bayestestR for the processing of draws.

easystats/modelbased#302

@DominiqueMakowski DominiqueMakowski changed the title Internal processing of marginaleffects objects In-house processing of marginaleffects objects Jan 11, 2025
@strengejacke strengejacke added the Enhancement 💥 Implemented features can be improved or revised label Jan 13, 2025
@strengejacke
Copy link
Member

We should probably submit bayestestR (easystats/bayestestR#691) the next days, then we should have the basis for this PR.

@DominiqueMakowski
Copy link
Member Author

By daniel here about modelbased:

No, we fully support Bayesian models. For Bayesian models, we now call describe_posterior(), too. We could do this for the parameters package as well, but that doesn't affect modelbased.

I'm all for outsourcing its postprocessing to parameters, this feels like the right place to have it. So I'd move the postprocessing from modelbased to here and have modelbased call parameters().

@strengejacke
Copy link
Member

Agree. But I think we can wait for 1.0.0 release to do this (both parameters and marginaleffects)

@mattansb
Copy link
Member

I suggest, wherever the method is, to use the get_datagrid() function - it's what is used in bayestestR and it works great there 😄

@strengejacke
Copy link
Member

Yes, I would call tidy() for frequentist models, because this is maintained in marginaleffects. And for Bayesian models, we call describe_posterior() instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 💥 Implemented features can be improved or revised
Projects
None yet
Development

No branches or pull requests

3 participants