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

Bias adjustment #388

Closed
strengejacke opened this issue Jun 22, 2022 · 3 comments
Closed

Bias adjustment #388

strengejacke opened this issue Jun 22, 2022 · 3 comments

Comments

@strengejacke
Copy link
Contributor

See easystats/modelbased#57
Would be cool to have such a feature (if it's no yet implemented?)

@vincentarelbundock
Copy link
Owner

That's interesting. In marginal effects, the 4 core functions and quantities are: marginaleffects, comparisons, predictions, and marginalmeans.

In general, we can't really do back-transformations on contrasts or marginal effects: #390

In predictions() the back transformations are delegated to insight::get_predicted, so we would have to implement it there.

I guess that means that the bias correction could only potentially be implemented in the marginalmeans() function. In that context, I think it would be very easy to pass a function to the transform_post argument: https://vincentarelbundock.github.io/marginaleffects/reference/marginalmeans.html

Any function supplied to this argument will be applied to the estimates and confidence intervals at the very end of the computation process, which I guess is what we need here. We could also possibly include a string shortcut like transform_post="whatever" to make things easier for the user.

Frankly, I'm not sure I'm expert enough in this bias correction to implement it correctly. But I'm definitely open to the idea.

@strengejacke
Copy link
Contributor Author

Frankly, I'm not sure I'm expert enough in this bias correction to implement it correctly

Damn, that was the main reason I opened an issue here... 😉

@vincentarelbundock
Copy link
Owner

Will be happy to continue the conversation if someone has an idea for how to implement this in marginaleffects, but since I don't have the knowledge, I'm unlikely to do this myself. So going to close the issue to keep things tidy in the repo, but feel free to re-open or keep the conversation going if you have thoughts.

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