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

Mention self._vcov in docs #527

Merged
merged 9 commits into from
Jul 6, 2024
2 changes: 1 addition & 1 deletion pyfixest/estimation/feols_.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def vcov(
# update p-value, t-stat, standard error, confint
self.get_inference()

return self
return self._vcov
Copy link
Member

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 ?


def _vcov_iid(self):
_N = self._N
Expand Down
Loading