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

predict(..., newdata) #21

Open
grantmcdermott opened this issue Sep 19, 2024 · 2 comments
Open

predict(..., newdata) #21

grantmcdermott opened this issue Sep 19, 2024 · 2 comments

Comments

@grantmcdermott
Copy link

Hi @amrei-stammann,

Would it be possible to support a newdata argument as part of the predict.feglm method?

This, in turn, would open up support for marginaleffects (c.f. vincentarelbundock/marginaleffects#786), which would be quite useful.

(Although, I think that #14 would probably need to be resolved too.)

Thanks for considering and for this very useful package!

@amrei-stammann
Copy link
Owner

Hi,

thanks for your suggestion. I agree, it would be awesome to have a working integration with the marginaleffects package, especially to easily compute bias-corrected APEs for functional forms (e.g. interactions or quadratics).

Since I’m also developing bias corrections on the econometric theory side, I just want to note that opening the newdata argument in predict alone would not be enough. Just to name two crucial points:

  1. Bias-correcting APEs requires more than just inserting an adjusted linear index into the standard APE derivatives.
  2. Computing APEs is tricky with perfectly classified observations.

We definitely want to offer a user friendly way to compute (bias-corrected) APEs for functional forms in the near future and I will explore what will be the best way to do so.

Best wishes,
Amrei

PS. We actually did not support the newdata option in predict because usually people want to use it for out-of-sample predictions, which requires some not so inncocent assumptions in the fixed effects context.

@grantmcdermott
Copy link
Author

Thanks Amrei, that all makes sense to me. Happy to test drive once you settle on an implementation. Cheers.

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