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

Gabor's Data PyFixest Wishlist #752

Open
5 of 7 tasks
s3alfisc opened this issue Dec 16, 2024 · 10 comments
Open
5 of 7 tasks

Gabor's Data PyFixest Wishlist #752

s3alfisc opened this issue Dec 16, 2024 · 10 comments

Comments

@s3alfisc
Copy link
Member

s3alfisc commented Dec 16, 2024

I plan to tackle some of these over the holidays:

  • no prediction interval -> LOW EFFORT if no fixed effects supported, as PR prepared by @greenguy33, more effort with fixed effects
  • R2 for WLS -> LOW EFFORT Issue
  • logit support -> HIGH EFFORT. Issue: link. PR in progress here
  • probit support -> HIGH EFFORT. PR in progress here
  • HAC SEs -> MEDIAN EFFORT Issue
  • locally defined functions cannot be used inside the formula (lspline) -> FEASIBILITY?
  • ARIMA VAR -> WONT DO
@adamvig96
Copy link
Contributor

adamvig96 commented Dec 30, 2024

Hi @s3alfisc,

I created a poc for context capture aka locally defined functions cannot be used inside the formula (lspline) here: adamvig96@96fa4fc

I think it would be good to have this in pyfixest, apart from the fact that we'd need it in the Gabor's DA book codebase – eg. statsmodels have this functionality. This is just a POC as I'm not familiar with the pyfixest codebase, but it worked for me in some case studies I tested.

FYI @gbekes, we need this for logit and probit too as splines are used extensively there.

@s3alfisc
Copy link
Member Author

Hi @adamvig96 , to make sure I understand the problem correctly - you need formulaic to parse a custom data transform (in this case a spline) and need to provide the extra context via the feols / fepois APIs? If yes I very much agree that this would be a very useful feature to have!

If yes, I took a quick initial look at your code and I think it looks quite good already - I don't think there'd be much to add except maybe some tests (happy to help with that =) ). If you open a PR, we can get started with getting this into pyfixest =)

@adamvig96
Copy link
Contributor

Yes, I think that's an accurate description of the issue. I opened #769 and #770.

@s3alfisc
Copy link
Member Author

Thanks!

@s3alfisc
Copy link
Member Author

s3alfisc commented Jan 3, 2025

I will merge logit + probit tomorrow (I am encountering a strange bug that I currently cannot explain), will then continue with R2 for WLS. Then the prediction intervals, last HAC.

@s3alfisc
Copy link
Member Author

s3alfisc commented Mar 1, 2025

We've just merged R2 for WLS (and within and adjusted R2 too)! PR here, thanks to @AronNemeth. I am also finalizing the prediction standard error PR , I should finish it by tomorrow evening. Then only HAC will be left =)

@s3alfisc
Copy link
Member Author

s3alfisc commented Mar 6, 2025

... and we've merged the prediction errors PR. @adamvig96 @gbekes

@DanielBarabas
Copy link

Hi, @s3alfisc, in chapter 17 of the book we would like to show the AMEs of a logit. In the documentation you gave an example using the marginaleffects package that I tried to replicate (in the "Quick reminder about probability models" part of the notebook) but the avg_slopes function simply gives back the original logit coefficients, not the AMEs, as if it was an OLS regression. Have you encountered anything similar? Or do you have any ideas that we chould try?

On another note: in our conda environment we could only use marginaleffects==0.0.11 because of a dependency issue regarding numpy (numba needs numpy<1.27, that comes with pyfixest, while marginaleffects=0.1.0 needs numpy>2.0.0), maybe this causes the issue?

@s3alfisc
Copy link
Member Author

s3alfisc commented Mar 27, 2025

Hi @DanielBarabas , this can indeed be the case!

To create the docs, I am using marginaleffects 0.0.14:

marginaleffects            0.0.14                                     147.1 KiB   pypi   marginaleffects-0.0.14-py3-none-any.whl

But I am also running higher numpy and numba versions?

numba                      0.61.0                                     11.7 MiB    pypi   numba-0.61.0-cp312-cp312-win_amd64.whl
numpy                      2.1.3                                      40.2 MiB    pypi   numpy-2.1.3-cp312-cp312-win_amd64.whl

This is all under pyfixest 0.28.0 and the docs environment. I suppose you are running the same version as you are installing from pypi?

Which version of numba do you have installed?

@DanielBarabas
Copy link

Thanks, I will check the numba bc that might be it (when i get to my laptop)

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