-
Notifications
You must be signed in to change notification settings - Fork 36
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
Mention self._vcov
in docs
#527
Conversation
pyfixest/estimation/feols_.py
Outdated
@@ -478,7 +478,7 @@ def vcov( | |||
# update p-value, t-stat, standard error, confint | |||
self.get_inference() | |||
|
|||
return self | |||
return self._vcov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that things might be a little bit more complicated than just this simple change
Doing as above would introduce a breaking changes as users could no longer run code as
import pyfixest as pf
pf.feols("Y~X1", data = pf.get_data).vcov("hetero").summary()
I'm not really sure if many use such syntax, but I have certainly seen it already =)
One option would be to add a "return_vcov" function argument, which defaults to False, in which case the Feols
object would be returned (i.e. the status quo), whereas if True
, we'd return the full vcov matrix.
I also wonder if we should add a function that allows users to control if they want to overwrite inferential results in the Feols instance whenever they call .vcov
?
I.e. right now, whenever vcov()
is called, the _vcov
attribute of the Feols instance is updated, and self.get_inference()
updates t-statistics, p-values, etc.
What do you think @greenguy33 ?
Another simple option to make the |
Super cool, there's plenty of things to do! I'll reach out about this later today =) |
@s3alfisc This makes sense and I feel like either of the solutions that you proposed would be fine. Maybe just exposing the .vcov attribute of feols is the most intuitive option for now. Either way, is there a way that a user can find out about how this works, other than looking at this issue or reviewing source code? I feel like documentatupn would be helpful here - unless it already exists and I've missed it, that's something I'd be happy to help work on. |
Then let's go with that solution! The only thing you would have to do is to go to your text editor and replace all of the references to
Maybe we could add this to the inference section of the quickstart notebook? |
Yes sure! I can get to this soon and make another PR. Sorry for so many questions - but should I be running the tests before sending in new code? |
You mean the ci/unit tests? You don't have to run them locally, I can run them via GitHub actions. Just haven't yet done so for the current PR as I think they would fail. Btw, you can also simply update this PR, no need to open a new one =) |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Hi @s3alfisc, I updated this pull request by changing to use |
rename `self._vcov` to `self.vcov` in the `lpdid` class
the vcov attribute is always available =)
Hi @greenguy33 , I made two minor changes. The vcov attribute is always available (users don't need to call @all-contributors please add @greenguy33 for code and docs |
I've put up a pull request to add @greenguy33! 🎉 |
It looks like there are a lot of |
Whoops...I will go back and take a closer look asap |
No worries - funnily I also checked and I did not find any other |
Hey @s3alfisc, I'm seeing a lot of errors like this in the failed tests:
It looks like Python does not support class attributes and methods of the same name. Its default behavior is to try to call the value of the attribute as a method, which fails. I wrote a quick sanity check to demonstrate:
I think the Pythonic way to handle this might be to use a property decorator, so that both |
Hm I would think the it's likely best to simply keep things as they are but to prominently point out in the vignette that one can access the vcov matrix via "Feols._vcov"? So basically we would scrap all changes and only keep the notebook updates? |
replacing .vcov with ._vcov
.vcov to ._vcov
Hi @s3alfisc, your plan sounds good to me. I updated the commit to only include the change in the quickstart, and also corrected one other small issue in the quickstart I found ("fixed effects" instead of "fix effects").. |
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
self._vcov
in docs
Yes, this was indeed a lot of back and forth for a very small change =) Thank you Hayden (@greenguy33)! Looking forward to continue working with you =) Please suggest all the features that you'd like to see added to pyfixest 😄 Is there any area of stats / econometrics that you're particularly interested in? I'd also be happy to have a chat and introduce you to the codebase / set of open issues =) |
@s3alfisc I have a software engineering background but am self-taught in statistics. I'm currently working on a PhD dissertation at UC Irvine that involves climate econometric modeling, which is what I needed to use this library for! I think that I will have around 2-3 hours a week to work on this library, as I have been meaning to get more involved with working on open-source codebases and this seems like a great opportunity. A call sometime to discuss the codebase and possible areas to work on sounds great! Maybe we can get in touch via e-mail? Feel free to drop me a line at hfreedma@uci.edu |
Sounds awesome! I'll send you an email once I'm back home =) |
@s3alfisc I made the small change we discussed. I'm also interested in continuing to contribute to this project if I can be helpful in any way!